Python, installing 3rd party packages using `pip`

The Python standard library contains a huge number of utilities that simplify our Python development needs, but nothing can satisfy everything.

That’s why individuals and companies create packages, and make them available as open source…


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

The Python standard library contains a huge number of utilities that simplify our Python development needs, but nothing can satisfy everything.

That’s why individuals and companies create packages, and make them available as open source software for the entire community.

Those modules are all collected in a single place, the Python Package Index available at https://pypi.org, and they can be installed on your system using pip.

There are more than 270.000 packages freely available, at the time of writing.

You should have pip already installed if you followed the Python installation instructions.

Install any package using the command pip install:

pip install <package>

or, if you do have troubles, you can also run it through python -m:

python -m pip install <package>

For example you can install the requests package, a popular HTTP library:

pip install requests

and once you do, it will be available for all your Python scripts, because packages are installed globally.

The exact location depends on your operating system.

On macOS, running Python 3.9, the location is /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages.

Upgrade a package to its latest version using:

pip install –U <package>

Install a specific version of a package using:

pip install <package>==<version>

Uninstall a package using:

pip uninstall <package>

Show an installed package details, including version, documentation website and author information using:

pip show <package>


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com


Print Share Comment Cite Upload Translate Updates
APA

flaviocopes.com | Sciencx (2021-02-01T05:00:00+00:00) Python, installing 3rd party packages using `pip`. Retrieved from https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/

MLA
" » Python, installing 3rd party packages using `pip`." flaviocopes.com | Sciencx - Monday February 1, 2021, https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/
HARVARD
flaviocopes.com | Sciencx Monday February 1, 2021 » Python, installing 3rd party packages using `pip`., viewed ,<https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/>
VANCOUVER
flaviocopes.com | Sciencx - » Python, installing 3rd party packages using `pip`. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/
CHICAGO
" » Python, installing 3rd party packages using `pip`." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/
IEEE
" » Python, installing 3rd party packages using `pip`." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/. [Accessed: ]
rf:citation
» Python, installing 3rd party packages using `pip` | flaviocopes.com | Sciencx | https://www.scien.cx/2021/02/01/python-installing-3rd-party-packages-using-pip/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.