hossein hayati
hossein hayati

Reputation: 1158

how can I find the path of virtualenv python

how can I find the path of virtualenv python ,built with this tutorial?
(i want to find python in this env and use it in my eclipse)

$ sudo pip install virtualenv virtualenvwrapper
$ export WORKON_HOME=$HOME/.virtualenvs
$ source /usr/local/bin/virtualenvwrapper.sh

$ echo -e "\n# virtualenv and virtualenvwrapper" >> ~/.bashrc
$ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
$ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc

$ source ~/.bashrc

$ mkvirtualenv cv -p python3

Upvotes: 15

Views: 77076

Answers (3)

Emilio
Emilio

Reputation: 2752

There is VIRTUAL_ENV system variable already set with the path.

Check <your_venv>/bin/activate (which is a simple script) to see how the virtual env is setup in general, but this variable will give you the clean path already:

echo $VIRTUAL_ENV
<full virtual env path>

Upvotes: 6

Attie
Attie

Reputation: 6969

You can use which to find out which binary will be executed...

For example:

$ which python3
/home/attie/projects/thing/venv/bin/python3

By default it just shows the first match, but you can give the -a argument to show all:

$ which -a python3
/home/attie/projects/thing/venv/bin/python3
/usr/bin/python3

Upvotes: 26

phd
phd

Reputation: 94397

mkvirtualenv creates virtualenvs in $WORKON_HOME, that is your virtualenv is in $HOME/.virtualenvs/cv/.

Upvotes: 3

Related Questions