This part of the error diagnostic tells you what the build system is trying to execute:
[cmd: [‘python’, ‘-u’, ‘/Users/axis_mundi/Documents/test_01.py’]]
So, it’s trying to execute a program named python
, and giving it the full name of the current file.
You mention that your Conda settings specify:
“executable”: “~/anaconda3/bin/python3”
However, that is python3
and not python
; hence when the build tries to execute, it presumably is failing because there is no program named python
anywhere. Generally speaking, python
is Python 2 and python3
is Python 3 (except on windows where they’re all python
and the world makes no sense).
I would guess that the build you have selected is not doing what you think it is doing, in as much as it’s set to run the wrong Python.
The build system that ships with Sublime for Python out of the box (in the build that you’re using) is:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"windows": {
"cmd": ["py", "-u", "$file"],
},
"variants":
[
{
"name": "Syntax Check",
"cmd": ["python3", "-m", "py_compile", "$file"],
"windows": {
"cmd": ["py", "-m", "py_compile", "$file"],
}
}
]
}
So, since you have a python3
installed, if you used this build it would likely work better than the one that you have currently, if your PATH
was correct.
As outlined in the diagnostics, the PATH
contains the following paths:
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/axis_mundi/Library/Application Support/JetBrains/Toolbox/scripts
None of those is /Users/axis_mundi/anaconda/bin
, so even if you did use the default build, it won’t be able to find that particular python3
when it looks; updating the PATH
might resolve that.
The PATH
is not a Sublime concept, it’s an OS concept; you need to adjust the profile files for your shell (likely zsh
if you’re on a recent MacOS, bash
if not) to augment the PATH
, and then restart Sublime for the change to take effect.
Alternately, if you’re using something that is Anaconda related in Sublime, which it seems like you are since you have settings for it, its config might need to be tweaked, or you might have to select a different build so that it knows to look in the correct place.