Home > Software engineering >  Hello_World program using Python 3.10 gives me an error
Hello_World program using Python 3.10 gives me an error

Time:09-01

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

CodePudding user response:

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.

CodePudding user response:

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 :)

  • Related