Virtualenv and Komodo IDE 6 on Windows

2019-05-18 07:04发布

问题:

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):

http://pypi.python.org/pypi/virtualenvwrapper-win

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:

http://blog.haydon.id.au/2010/11/taming-komodo-dragon-for-virtualenv-and.html

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:

Win7, Python 2.6, Komodo IDE 6.1.3

Thanks in advance!

回答1:

I finally ended up posting the same question on the ActiveState forum. The reply was that it doesn't officially support VirtualEnv, yet. But, that you can make get it to work by adjusting the paths, etc. Here is the link to the question/reply.

http://community.activestate.com/node/7499



回答2:

You can do this by adding the virtualenv's Python library to the project. Right-click on Project > Properties > Languages > Python > Additional Python Import Directories.

Now if someone could tell me how to add a folder like that in Mac when the virtualenv is under a hidden folder (without turning hidden folders on in Finder).



回答3:

Use the context menu to setup virtualenv. Right-click on Project > Properties > Languages > Python > Additional Python Import Directories.

Use an alias in .profile to add support for rvm.

alias komodo='open -a "Komodo Edit"'

From there, type "rvm use ree( or rbx, or 1.9.1, or whichever version you want)."