Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3 inside Sublime Text with Anaconda on a mac

I cannot seem to get Python3 interpreter to build inside sublime text using Anaconda. I have tried all possible configurations but to no avail, the system does not seem recognize installed libraries and throws an importError back at me.

this is my python project's settings for anaconda:

{
    "build_systems":
    [
        {
            "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
            "name": "Anaconda Python Builder",
            "selector": "source.python",
            "shell_cmd": "\"/usr/local/bin/python3\" -u \"$file\""
        }
    ],
    "folders":
    [
        {
            "path": "Practice"
        }
    ],
    "settings":
    {
        "python_interpreter": "python3"
    }
}

edit: python3 installed with homebrew

like image 865
Suraj Sharma Avatar asked Feb 19 '26 17:02

Suraj Sharma


2 Answers

Tools -> Command Palette -> Anaconda: Set Python interpreter

like image 158
Dmitry Avatar answered Feb 27 '26 10:02

Dmitry


Try this:

{
    "python_interpreter": "/usr/local/bin/python3",

}

This only works if you installed it to that actual path, which should be the case if you used homebrew.

To confirm try in your shell:

which python3
like image 43
BluePython Avatar answered Feb 27 '26 10:02

BluePython