Skip to content

Python, installing 3rd party packages using `pip`

New Course Coming Soon:

Get Really Good at Git

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>
Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. A course that helps you feel less frustrated with Git. Launching May 21, 2024. Join the waiting list!
→ Get my Python Handbook
→ Get my Python Handbook

Here is how can I help you: