Virtualenv and Komodo IDE on Windows

Posted by dsaracini on 2011-11-21 16:57

As a developer that has worked on more than one python project at once, I love the idea of Virtualenv. But, I'm currently trying to get Komodo IDE to play nice with VirtualEnv on a Windows box. I've downloaded virtualenvwrapper-win and got it working (btw, you are using Virtualenv on windows you should check it out):

however, I can't quite figure out what I need to do to get Komodo IDE to respect it all. I found the following for Mac users:

But, so far, no luck. I'm pretty sure that I need to set a postactivate script to set some environment variables for Komodo to pick up.

Has anyone gotten this working before?

I'm using:

Windows 7, Python 2.6, Komodo IDE 6.1.3

Thanks in advance!

ActiveState Staff
Tue, 2011-11-22 13:41

Komodo (still) doesn't have builtin support for virtualenv (or similar
tools for other languages, like Ruby's RVM), but the following the
steps in the referenced article should work. Komodo 7 (now in beta)
supports project-specific interpreters, but you would still need to
manually manage the PATH and PYTHONHOME variables.

I would write a suite of macros to emulate [virtualenv]/bin/activate,
and set them accordingly.

var envCls = Components.classes[";1"].getService()

gives you access to Python's environment variables, and then you can use

var os = Components.classes[";1"].getService()

to parse envCls.get("PATH") using os.pathsep

I do something similar for Ruby, particularly because I found the
way RVM had redefined cd was breaking my workflow.

No doubt it's worth adding this functionality to Komodo, but it's not
a top priority right now.

- Eric