Search code examples
sublimetext2sublimecodeintel

SublimeCodeIntel - how to set path to Python 3 installation


I have Python 3.x installation in Windows in "c:\Pyhton3" folder. How can I specify Python folder location for SublimeCodeIntel --so it can find Python 3 source files by "Find declaration" cmd? What to write in .codeintel/config file?

E.g. I want to put caret onto os.path.isfile and find source py file - with this id.


Solution

  • The SublimeCodeIntel configuration documentation on GitHub has all the information you need. Basically, an entry like this should work:

    {
        "Python3": {
            "python": 'c:/python3/python.exe',
            "pythonExtraPaths": ["c:/python3/lib", "c:/python3/lib/site-packages"]
        }
    }
    

    Additionally, take a look at Preferences -> Package Settings -> SublimeCodeIntel -> Settings - Default. Down at the bottom are some more Python-specific settings:

        "Python": {
            "env": {
                /*
                "PATH": "/usr/local/bin:/usr/local/sbin:$PATH",
                "PYTHONPATH": "/usr/local/lib/python2.7/site-packages:/usr/local/lib/python:$PYTHONPATH"
                */
            }
        }
    

    Get rid of the /* */ comments and change the paths to whatever you want on your Windows system.