Where are the files downloaded using pip stored in virtualenv?

21,384

Solution 1

To see where your virtualenv files are, enable it and issue the following bash command:

$ echo $VIRTUAL_ENV

Similar to your system's Python installation, the packages are stored inside lib/python2.*/site-packages/ directory. Find your package in there and edit the necessary files.

Solution 2

You need to know the path to env userena, firstly. Then the installed app usually is in path_to_userena/lib/python2.x/site-packages/. Django apps normally does not contain prefix django-, thus userena here.

Or you could find it in Python by

import os.path, userena
os.path.dirname(userena.__file__)

Solution 3

You will find virtualenv at home/.virtualenvs. In the .virtualenvs directory you will find your virtualenv

Solution 4

if you're using virtualenvwrapper (which i recommend):

lets say that i'm using already in using the foo virtualenv and I have virtualenvwrapper installed:

$ cdvirtualenv

if this command i'll go to the $VIRTUAL_ENV path which in this case is:

$ pwd
/home/bernardo/.virtualenvs/foo
$ ls
bin  build  include  lib  local

in my case to see my virtualenv packages i'll go to lib/python2.7/site-packages or:

$ lssitepackages
figleaf  figleaf-0.6.1-py2.7.egg-info  initools  INITools-0.3.1-py2.7.egg-info

the commands cdvirtualenv and lssitepackages comes from "virtualenvwrapper"

Solution 5

The packages you download using pip or any other method in a virtual env is stored in the virtual env folder i.e

Suppose you create a virtual environment ENV, so the downloaded packages will be inside ENV/lib/python2.7/site-packages

Share:
21,384

Related videos on Youtube

user
Author by

user

Updated on July 09, 2022

Comments

  • user
    user almost 2 years

    I am on linux mint 12. I have created a virtualenv called userena. and then i installed django-userena using pip in that virtualenv. I need to edit some django-usrena files. Where are they located?

  • user
    user about 12 years
    thank you sir so much, i have a little issue, my virtualenv is actually called userena-demo and if i do import os.path, userena-demo it will show this error SyntaxError: invalid syntax i think it's because of the Dash what to do in that case? do i have to rename the virtualenv? if yes, how to do so?
  • Charles Duffy
    Charles Duffy about 12 years
    @user it's not the virtualenv name but the module you installed into it which you should be importing to use this approach.
  • okm
    okm about 12 years
    @user As Charles described, userena here stands for the installed library django-userena
  • not2qubit
    not2qubit about 5 years
    This is the only answer that make sense