當我安裝了代碼運行器擴展并且我無法運行 python 程式時,會彈出這個錯誤:
[![圖片][1]][1]
Copyright ? Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Warning: PowerShell detected that you might be using a screen-reader and has disabled PSReadLine for compatibility purposes.
If you want to re-enable it, run 'Import - Module PSReadLine'.
PS C:\Users\Admin\OneDrive\Máy tính\py projects python -u " C\Users\ Admin\OneDrive\Máy tính\py project\test.py " python : The term 'python' is not recognized as the name of a cmdlet , function ,script file ,or operable program. Check the spelling of the name ,or if a path was included ,verify that the path is correct and try again.
At line :1 char :1
python -u " C:\Users\Admin\OneDrive\Máy tính\py project\test.py " ' ~~~~~~
CategoryInfo : ObjectNotFound: (python:String) [], CommandNotException
FullyQualifiedErrorId : CommandNotFoundException
當我關閉擴展程式時,代碼正常運行,但是當我打開時,錯誤彈出。感謝您閱讀我的問題!(??ω??)?[1]:
更新:

您可以使用此選項來運行您的 python 檔案。這是微軟官方提供的檔案運行選項。
uj5u.com熱心網友回復:
確保你已經安裝了 python。在 VScode 的左下角,你必須選擇一個解釋器并確保你選擇了 python。如果您需要選擇您的語言,請選擇 python,并將您的檔案命名為“FileName.py”。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/471776.html
標籤:Python 视觉工作室代码 vscode-代码运行器
上一篇:VisualStudio無法運行pre/post提交掛鉤:/usr/bin/env'bash':Nosuchfileordirectory
