SublimeCodeIntel - how to set path to Python 3 installation
Asked Answered
G

1

5

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.

Garber answered 22/9, 2013 at 11:33 Comment(0)
W
9

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.

Wein answered 23/9, 2013 at 16:21 Comment(2)
Do you have to set both? In windows there is "C:\Users\MyUser\.codeintel\config" and "C:\Users\MyUser\AppData\Roaming\Sublime Text 2\Packages\SublimeCodeIntel\.codeintel\config" and finally "C:\Users\MyUser\AppData\Roaming\Sublime Text 2\Packages\SublimeCodeIntel\SublimeCodeIntel.sublime-settings".Lothair
@Lothair you have two options - either C:\Users\MyUser\.codeintel\config or %APPDATA%\Sublime Text 2\Packages\User\SublimeCodeIntel.sublime-settings. You should never modify .sublime-settings in the plugin's directory, as if you screw something up you don't have anything to go back on. Instead, copy the file to your Packages/User directory and edit it there. I find that easier than using .codeintel\config, as the settings file is easily accessed by going to Preferences -> Package Settings -> SublimeCodeIntel -> Settings - User.Wein

© 2022 - 2024 — McMap. All rights reserved.