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.

Prog1020
  • 4,530
  • 8
  • 31
  • 65

1 Answers1

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.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • 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". – Romz Jun 11 '14 at 02:45
  • @Romz 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`**. – MattDMo Jun 12 '14 at 02:06