Python pip: Difference between revisions
From wikinotes
No edit summary |
(→Usage) |
||
Line 25: | Line 25: | ||
pip install <package> # install package | pip install <package> # install package | ||
pip install --user <package> # install to $HOME dir | pip install --user <package> # install to $HOME dir | ||
pip install --user \ `# install to $HOME dir, bypassing externally managed envs` | |||
--break-system-packages \ | |||
<package> | |||
pip install "${package}==1.1.1" # install specific version of package | pip install "${package}==1.1.1" # install specific version of package | ||
pip install 'git+https://github.com/tangentlabs/django-oscar-paypal.git@master | pip install 'git+https://github.com/tangentlabs/django-oscar-paypal.git@master |
Latest revision as of 02:34, 7 July 2023
python package manager.
Locations
~/.local/lib/pythonX.X/site-packages
user packages /etc/pip.conf
~/.config/pip/pip.conf
pip configuration
Install
python2 <(curl https://bootstrap.pypa.io/pip/2.7/get-pip.py) python3 <(curl https://bootstrap.pypa.io/pip/get-pip.py)
Usage
pip install <package> # install package pip install --user <package> # install to $HOME dir pip install --user \ `# install to $HOME dir, bypassing externally managed envs` --break-system-packages \ <package> pip install "${package}==1.1.1" # install specific version of package pip install 'git+https://github.com/tangentlabs/django-oscar-paypal.git@master pip list # list installed pip search <package> # deprecatedimport site site.getusersitedir() # pip install --user packages installed here
Configuration
[global] # if you MUST install system packages with pip, this is your escape-hatch break-system-packages = true