pip3 - the Python package installer
pip install [-r requirements.txt] PACKAGE... | pip freeze | pip list | pip show PACKAGE | pip uninstall PACKAGE
Options you will use
install PKG- Install a package and its dependencies into the ACTIVE environment.
install -r FILE- Install everything listed in a requirements file.
freeze- Print installed packages as name==version lines - the format of requirements.txt.
list- Table of installed packages.
--break-system-packages- Override PEP 668 and install into the system interpreter. Do not.
--no-cache-dir- Disable the cache (~/.cache/pip).
-q, --quiet- Give less output.
-v, --verbose- Give more output.
--disable-pip-version-check- Do not check PyPI for a newer pip.
--no-cache-dir- Disable the cache (~/.cache/pip).
-q, --quiet- Give less output.
-v, --verbose- Give more output.
--disable-pip-version-check- Do not check PyPI for a newer pip.
Examples
$ pip install requestsInside a venv: installs requests, urllib3, idna, certifi, charset-normalizer.
$ pip freeze > requirements.txtPin exactly what you have, so the next machine gets the same versions.
Gotchas
- On Ubuntu 23.04 and later, pip on the system python3 fails with "error: externally-managed-environment". That is PEP 668 protecting the packages apt installed: mixing pip into /usr breaks apt-managed tools.
Try pip3 in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.