| pip | ||||||||||||||||||||||||||||||||
| *** | Programming_Python | |||||||||||||||||||||||||||||||
| Ver | pip | |||||||||||||||||||||||||||||||
| 7/16/24 | ||||||||||||||||||||||||||||||||
| Index | ||||||||||||||||||||||||||||||||
| Basic | https://en.wikipedia.org/wiki/Pip_(package_manager) | |||||||||||||||||||||||||||||||
| dotnetperls | ||||||||||||||||||||||||||||||||
| other | pip | a package management system used to install and manage software packages written in Python. | Pip Installs Packages | |||||||||||||||||||||||||||||
| pip | Pip Installs Python | |||||||||||||||||||||||||||||||
| PySerial | Most distributions of Python come with pip preinstalled. | |||||||||||||||||||||||||||||||
| If pip is missing, it can be installed through the system package manager or by invoking cURL, a client-side data transfer tool: | ||||||||||||||||||||||||||||||||
| curl https://bootstrap.pypa.io/get-pip.py | python | ||||||||||||||||||||||||||||||||
| One major advantage of pip is the ease of its command-line interface, which makes installing Python software packages as easy as issuing one command: | ||||||||||||||||||||||||||||||||
| pip install some-package-name | ||||||||||||||||||||||||||||||||
| pip uninstall some-package-name | Users can also easily remove the package: | |||||||||||||||||||||||||||||||
| Most importantly pip has a feature to manage full lists of packages and corresponding version numbers, possible through a "requirements" file. | ||||||||||||||||||||||||||||||||
| This permits the efficient re-creation of an entire group of packages in a separate environment (e.g. another computer) or virtual environment. | ||||||||||||||||||||||||||||||||
| This can be achieved with a properly formatted requirements.txt file and the following command | ||||||||||||||||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||||||||||||||||
| Install some package for a specific version python, where ${version} is replaced for 2, 3, 3.4, etc.: | ||||||||||||||||||||||||||||||||
| pip${version} install some-package-name | ||||||||||||||||||||||||||||||||
| # | pip install --upgrade pip | upgrading via the 'pip install --upgrade pip' command | don't do | |||||||||||||||||||||||||||||
| Install PIP on Debian | https://linuxize.com/post/how-to-install-pip-on-debian-10/ | |||||||||||||||||||||||||||||||
| apt install python3-pip | ||||||||||||||||||||||||||||||||
| Only ever use your system package manager to upgrade the system pip. | ||||||||||||||||||||||||||||||||
| ImportError in system pip wrappers after an upgrade #5599 | https://github.com/pypa/pip/issues/5599 | The system installed pip is owned by the distribution, and if you don't use distribution-supplied tools to manage it, you will hit problems. | ||||||||||||||||||||||||||||||
| Yes, we know pip says "you should upgrade with pip install -U pip" - that's true in a pip-managed installation, the system pip, but they don't. | ||||||||||||||||||||||||||||||||
| workaround > | python3 -m pip -V | ideally distributions should patch this message to give appropriate instructions in the system pip, but they don't. | ||||||||||||||||||||||||||||||
| python3 -m pip install shodan | ||||||||||||||||||||||||||||||||
| python3-pip is already the newest version (18.1-5). | ||||||||||||||||||||||||||||||||
| python3 -m pip list | 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. | |||||||||||||||||||||||||||||||
| root@T30:~# pip3 --version | ||||||||||||||||||||||||||||||||
| pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7) | ||||||||||||||||||||||||||||||||
| root@T30:~# pip3 install --upgrade pip | ||||||||||||||||||||||||||||||||
| Collecting pip | ||||||||||||||||||||||||||||||||
| Downloading https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl (1.5MB) | ||||||||||||||||||||||||||||||||
| 100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 1.5MB 1.2MB/s | ||||||||||||||||||||||||||||||||
| Installing collected packages: pip | ||||||||||||||||||||||||||||||||
| Found existing installation: pip 18.1 | ||||||||||||||||||||||||||||||||
| Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr | ||||||||||||||||||||||||||||||||
| Can't uninstall 'pip'. No files were found to uninstall. | ||||||||||||||||||||||||||||||||
| Successfully installed pip-20.1 | ||||||||||||||||||||||||||||||||
| root@T30:~# pip3 --version | ||||||||||||||||||||||||||||||||
| WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. | ||||||||||||||||||||||||||||||||
| Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. | ||||||||||||||||||||||||||||||||
| To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. | ||||||||||||||||||||||||||||||||
| pip 20.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7) | ||||||||||||||||||||||||||||||||