[英]Hello_World program using Python 3.10 gives me an error
我開始學習 Python。
我使用 Sublime Text 創建了一個簡單的 print("Hello World") 程序,並將其保存為 .py 文件
我點擊工具/構建並給我這個錯誤:
[WinError 2] The system cannot find the file specified
[cmd: ['py', '-u', 'C:\\Users\\OscarZ\\Desktop\\python_work\\hello_world.py']]
[dir: C:\Users\OscarZ\Desktop\python_work]
[path:C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program
Files\dotnet\;C:\Users\OscarZ\AppData\Local\Microsoft\WindowsApps]
[Finished]
為什么找不到文件? 我正在使用 Sublime 文本編輯器打開它
謝謝
我猜您正在嘗試使用 sublime 的“構建系統”來運行您的 python 代碼,並且您需要通過單擊“工具”->“構建方式...”來選擇構建系統,如果可以看到,請選擇“python” .
Write python
in cmd, if the output shows a version of python, then python is fully installed, If it show something else, go for reinstalling python from https://www.python.org/downloads/ If the python is installed correctly,嘗試在 IDE Python 中運行相同的命令,如果程序運行正常,則與 Sublime Text 連接的連接存在錯誤或錯誤,請嘗試重新建立連接,或重新安裝編輯器
希望有效:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.