Skip to content

Python3 pip

pip is a Python package management tool that provides functions for finding, downloading, installing, and uninstalling Python packages.

Packages can also be found at https://pypi.org/.

The latest Python versions come with pip pre-installed.

Note: Python 2.7.9+ or Python 3.4+ and above come with pip built-in.

If not installed, refer to: Python pip Installation and Usage.

To check if pip is already installed, use the following command:

pip --version

To download and install a package, use the following command:

pip install some-package-name

For example, to install the numpy package:

pip install numpy

You can also easily remove a package with the following command:

pip uninstall some-package-name

For example, to remove the numpy package:

pip uninstall numpy

To view the packages you have installed, use the following command:

pip list

Exporting the Current Python Environment Configuration

Section titled “Exporting the Current Python Environment Configuration”

To export the configuration of the current Python environment, you can use the pip freeze command.

The pip freeze command lists all Python packages installed in the current environment along with their version information. You can save it to a file, such as requirements.txt, as shown below:

pip freeze > requirements.txt

The above command will create a file named requirements.txt in the current directory, containing all installed packages and their version information.

Then, you can use this file elsewhere to recreate the same environment by running the following command:

pip install -r requirements.txt

The above command will reinstall all required packages based on the packages and version information listed in requirements.txt, thereby recreating the same environment.


The Anaconda distribution includes Python.

Anaconda is an integrated data science and machine learning environment that includes the Python interpreter as well as a large number of commonly used data science libraries and tools.

The package, dependency, and environment management tool for Anaconda is the conda command. Compared to the traditional Python pip tool, Anaconda’s conda makes it easier to switch between different environments, and environment management is relatively simple.

For detailed Anaconda installation and introduction, refer to: Anaconda Tutorial.