[Fixed]-Where are the files downloaded using pip stored in virtualenv?

21👍

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.

6👍

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__)
👤okm

3👍

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

2👍

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”

1👍

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

👤Hiro

0👍

Proof Positive location derivation of pipenv installed packages:

Get the install base with ‘% pipenv –venv’

Run the install command a 2nd time, and pipenv will divulge the packages locations!

% pipenv install django djangorestframework pygments

  1. Installing django… Requirement already satisfied: django in
    /usr/local/lib/python3.7/site-packages/Django-2.1.1-py3.7.egg
    (2.1.1)
  2. Requirement already satisfied: pytz in
    /usr/local/lib/python3.7/site-packages/pytz-2018.5-py3.7.egg (from
    django) (2018.5)
  3. Adding django to Pipfile’s [packages]… Installing
    djangorestframework… Requirement already satisfied:
    djangorestframework in
    /Users/sww/.local/share/virtualenvs/env-YuUv1EZG/lib/python3.7/site-packages
    (3.8.2)
  4. Adding djangorestframework to Pipfile’s [packages]… Installing
    pygments… Requirement already satisfied: pygments in
    /Users/sww/.local/share/virtualenvs/env-YuUv1EZG/lib/python3.7/site-packages
    (2.2.0)

Leave a comment