If you are using Sublime Text 2, Sublime CodeIntel is a must have plugin. It provides code intelligence for languages ranging from Python to Javascript with features like code autocomplete and jump to symbol definition.

Working with virtualenv

It supports Python default installation out of the box but if you are working with virtualenv, then you will need to manually configure CodeIntel to pick up your virtual environment.

Configuration files are located at ~/.codeintel/config or project_root/.codeintel/config (you might need to create this yourself). Change the config file like so:

The example above is based on my virtualenv setup, yours might be different. So, please change accordingly.

9 Replies to “Sublime CodeIntel Configuration for virtualenv

  1. Hi… thanks for the post. I’ve been using Komodo IDE for my primary IDE/editor. It has good things about it, but is very slow sometimes. I’ve been trying out Sublime Text 2 tonight and like the speed, but can’t get it to give codeintel in a virtualenv project. It’s a Django project and it just gives and error “could not resolve first part of …”

    Have you used with Django? it seems like it would be like any other package and should work. Also, it should be noted that I originally it a “bug” in configuring things because I just copy/pasted your example above and edited the path for my .virtualenv/project… but, failed to notice that you have Python 2.6 and I’m using 2.7. You might point that out in your article. Might help someone. ???

    Thanks again for the post.

    • Hi David,

      I use Django, but not with ST2 and I’ve not tried ST2 with Django either. Plus, since I posted this, ST2 has been updated few times.

      Let me know if found a solution.

  2. Thank you for this hint! I am using it with a self created project_root/.codeintel/config file and it works great with a different Python version than the system built in. Also Django (in site-packages) can be used.

  3. Thank you for the article Matthew. I am concerned because every time I try to create a .codeintel directory in my project directory and delete the one in my home directory codeintel creates a new one in the home directory instead. I would prefer it create on in the project directory so that this could refer explicitly to the modules I have in my virtual environment. My question is: How to force the package to use the project directory and not the home folder (I see everywhere that either will work, but it won’t use the project one for me!)?

Leave a Reply to Tim Cancel reply

Your email address will not be published. Required fields are marked *