简体   繁体   中英

Hello_World program using Python 3.10 gives me an error

I'm starting to learn Python.

I've created an easy print("Hello World") program using Sublime Text, and saved it as a.py file

I hit Tools/Build and gives me this error:

[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]

Why doesn't it find the file? I'm opening it using the Sublime Text Editor

Thanks

I guess you are trying to use the 'Build System' of sublime to run your python codes, and you need to choose a build system by clicking 'Tools->Build With...' and selecting 'python' if you could see one.

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, try to run the same command in the IDE Python, If the program runs perfectly there is some mistake or bug in the connection with the Sublime Text connection, Try reestablishing the connection, or re installing the editor

Hope that works:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM