Post

Setup python for sublime text

Setup python environment in Sublime Text.

Select Tools -> Build System -> New Build System in sublime text. This will open a new build system config file. In that file delete everything and paste this:

1
2
3
4
5
{
    "cmd": ["PATH TO YOUR DESIRED PYTHON INTERPRETER","-u", "$file"],
    "selector": "source.python",
    "file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)"
}

Example path:

1
"cmd": ["D:/MyPrograms/anaconda3/python.exe","-u", "$file"]

Save this file.

Select the new build system you just created in Tool -> Build System -> [your new system].

Open a python script, type Ctrl+B, or Ctrl+shift+p, then find Build with: xxx and press Enter to build the python script.

References

https://stackoverflow.com/a/64581299

This post is licensed under CC BY 4.0 by the author.