Where does pip install its packages?
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Droplet of life
--
Chapters
00:00 Question
00:38 Accepted answer (Score 171)
01:14 Answer 2 (Score 1050)
01:35 Answer 3 (Score 179)
02:39 Answer 4 (Score 58)
02:58 Thank you
--
Full question
https://stackoverflow.com/questions/2998...
Question links:
[virtualenv]: http://pypi.python.org/pypi/virtualenv
Answer 2 links:
https://pip.pypa.io/en/stable/news/#b1-2...
[Ubuntu 18.04]: https://en.wikipedia.org/wiki/Ubuntu_ver...
https://github.com/pypa/pip/issues/5599
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #pip #virtualenv
#avk47
ANSWER 1
Score 1184
pip show <package name> will provide the location for Windows and macOS, and I'm guessing any system. :)
For example:
> pip show cvxopt
Name: cvxopt
Version: 1.2.0
...
Location: /usr/local/lib/python2.7/site-packages
ANSWER 2
Score 224
pip list -v can be used to list packages' install locations, introduced in https://pip.pypa.io/en/stable/news/#b1-2018-03-31
Show install locations when list command ran with “-v” option. (#979)
>pip list -v
Package Version Location Installer
------------------------ --------- -------------------------------------------------------------------- ---------
alabaster 0.7.12 c:\users\me\appdata\local\programs\python\python38\lib\site-packages pip
apipkg 1.5 c:\users\me\appdata\local\programs\python\python38\lib\site-packages pip
argcomplete 1.10.3 c:\users\me\appdata\local\programs\python\python38\lib\site-packages pip
astroid 2.3.3 c:\users\me\appdata\local\programs\python\python38\lib\site-packages pip
...
This feature is introduced in pip 10.0.0b1. On Ubuntu 18.04 (Bionic Beaver), pip or pip3 installed with sudo apt install python-pip or sudo apt install python3-pip is 9.0.1 which doesn't have this feature.
Check https://github.com/pypa/pip/issues/5599 for suitable ways of upgrading pip or pip3.
ACCEPTED ANSWER
Score 181
pip when used with virtualenv will generally install packages in the path <virtualenv_name>/lib/<python_ver>/site-packages.
For example, I created a test virtualenv named venv_test with Python 2.7, and the django folder is in venv_test/lib/python2.7/site-packages/django.
ANSWER 4
Score 66
Easiest way is probably
pip3 -V
This will show you where your pip is installed and therefore where your packages are located.