Friday, 15 February 2013

python 2.7 - VIRTUAL_ENV is not detected in pydev -



python 2.7 - VIRTUAL_ENV is not detected in pydev -

i'm using pydev eclipse , virtualenv python2.7 on debian squeeze python script requires variable os.environ['virtual_env'] there no virtual_env key when debug. if type in terminal:

. /my_virtualenv/bin/activate python import os os.environ['virtual_env']

then can see virtual_env in variable os.environ clues?

it appears virtualenv sets virtual_env variable part of it's activate script. pydev doesn't run activate script, doesn't have knowledge of environment variable.

you can set in run configuration though.

click little downwards arrow next run icon. click "run configurations..." in left pane select run configuration want modify. select "environment" tab on right side. click "new" , set virtual_env name , value desire.

python-2.7 pydev virtualenv

No comments:

Post a Comment