简体   繁体   中英

Sublime Text3 build error - Python not detected

I'm receiving the error "Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640 [Finished in 0.3s]" when trying to run

{
    "cmd": ["python3", "-u", "$file"],
}

I'm very new to python and I've tried other solutions on here with no effect. I'm also running on a windows 10 PC and made sure to add python 3.9 to path during installation. Sublime 3 worked fine initially, but after a using it a couple of times it started showing the error above. Could it be that I'm using a free version of Sublime?

First check if you can open python from a command prompt:

  1. Win+R
  2. Type python and press enter.

If python is open then try to add your custom .sublime-build for python:

  1. In sublime go to Tools > Build System > New Build System...
  2. Write this on that file:
{ 
    "shell_cmd": "python \"$file\""
}
  1. Save it with extension .sublime-build

I believe this is the simplest .sublime-build for python. When you press Ctrl+S to save it sublime will show you your sublime user folder. Save it right there with the name you want.

Then you will see it on Tools > Build System.

For more information see Sublime Build System Documentation

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