python - In what directory does virtualenvwrapper store site packages by default? -


virtualenvwrapper provides several variables:

$virtualenvwrapper_env_bin_dir        $virtualenvwrapper_project_filename   $virtualenvwrapper_script             $virtualenvwrapper_virtualenv_clone $virtualenvwrapper_hook_dir           $virtualenvwrapper_python             $virtualenvwrapper_virtualenv         $virtual_env 

i believe finding virtual environment cd $virtualenvwrapper_hook_dir , going name of environment created (cd my_environment).

that has 3 directories: bin, include , lib. unfortunately, none of these seems contain site-packages directory.

where go find these site-packages?

site-packages located in lib/python{major}.{minor}/ subdirectory of virtualenv.

e.g. in python 2.7 virtualenv:

$ ls -d lib/python?.?/site-packages/ lib/python2.7/site-packages/ 

but in python 3.4 virtualenv version number again matches:

$ ls -d lib/python?.?/site-packages/ lib/python3.4/site-packages/ 

you can use:

$virtual_env/lib/`$virtual_env/bin/python -c "import sys; print('python{0.major}.{0.minor}'.format(sys.version_info))"`/site-packages/ 

if wanted absolute path, using active virtualenv python binary produce version number.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -