0

I am brand new to setting up an editor for Python. I am trying to setup Sublime Text to start learning Python for my job.

I have setup the editor and attempt to run the 'Hello World' text using the Python build within Sublime.

The following error message occurs:

[WinError 2] The system cannot find the file specified
[cmd: ['py', '-u', 'C:\\Users\\myname\\OneDrive\\Documents\\Python_Projects\\intro.py']]
[dir: C:\Users\myname\OneDrive\Documents\Python_Projects]
[path: C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2021a\bin;C:\Users\myname\AppData\Local\Microsoft\WindowsApps;]
[Finished]

I tried running the code using automatic build settings and python build settings directly. Still no luck.

I see that a MATLAB file directory is being called in the "path:" and I thought maybe that might be the interference?

Thank you!

1 Answers1

0

I assume that if you are working with Sublime Text, then you have downloaded and installed the executable version of Python from Python.org. Here I show a reference just in case.

enter image description here

So, It seems, by your error messages, that in your "windows PATH" there isn't a reference to Python.exe. Maybe you have forgotten to mark the "Add Python.exe to PATH" box. This right here.

enter image description here

There is a way to add it manually, here is the link of the post that explains it: Adding Python to PATH on Windows

But in my case, I prefer to uninstall both "Sublime Text" and "Python" and reinstall it, I start with Python (don't forget to check the "path" box) and then install Sublime Text

You should verify that everything works fine by checking it in the TOOLS box in the Sublime Text menu bar. The version of Python you have installed will appear there.

enter image description here

Diroallu
  • 824
  • 1
  • 11
  • 15
  • 1
    Thank you for your helpful comment. I did not add Python to the PATH originally. This worked a treat! Thank you! – SystemsJake Feb 24 '23 at 17:05
  • You don't need to uninstall either Python or Sublime... and *especially* not Sublime, as it has nothing to do with the problem here. You just need to restart it after the PATH is changed. – MattDMo Feb 24 '23 at 18:25