How do I list the files associated with a Python package installed using pip or easy_install?

Solution 1:

You could do that by using command:

pip show -f <package>

Solution 2:

I use virtualenv with pip, so here are the steps I follow. Assume I'm working in the dave_venv virtual environment.

$ cat ~/.bashrc

export WORKON_HOME=/usr/local/virtualenvs

$ cd /usr/local/virtualenvs/dave_venv/lib/python2.6/site-packages
$ ls # This should show <your_package>.
$ cd <your_package>
$ ls # now you're looking at your package's files.

Solution 3:

Two years later, most pip instances have show, however, not all packages have the installed-files.txt program for the subcommand to read.

A workaround is to fire up the python shell and do this:

>>> import eventlet
>>> eventlet.__path__
    ['/usr/lib/python2.7/dist-packages/eventlet']

where "eventlet" is the package I installed with pip.

Tags:

Python

Pip