Install, uninstall, and upgrade packages
PyCharm provides methods for installing, uninstalling, and upgrading Python packages for a particular Python interpreter. It means that each project has its own set of packages, which is considered a best practice for Python dependency management. By default, PyCharm uses pip to manage project packages. For conda environments, you can use the conda package manager.
In PyCharm, you can preview and manage packages in the Python Packages tool window and in the Project Structure settings.
Manage packages in the Python Packages tool window
The Python Packages tool window provides the quickest way to preview and install packages for the currently selected Python interpreter. This tool window is enabled by default, and you can open it by clicking Python Packages on the right side of the IDE. You can also open it using the main menu: .
The Python Packages tool window shows installed packages and the packages available in the PyPI and conda package repositories. Use the search field to filter the list of the available packages.
To preview the package documentation, click Advanced Package Install... next to the package name and then Show package description.
Install packages
Start typing the package name in the search field of the Python Packages tool window. The matching packages are displayed.

If the current Python interpreter is a conda virtual environment, the packages available in the conda package repository are also displayed.
Select the package and then do one of the following:
Click Install next to the package name to automatically install the latest version of the package.

Choose the version from the list of available versions in the Advanced Package Install tool window and click Install.

If a popup with an error message appears, refer to the Troubleshooting guide for a solution.
Manage package repositories
You can specify a custom repository, for example, devpi or a private PyPi server.
Click
Options in the upper right corner of the Python Packages tool window.Alternatively, go to .
Click
Add and type the repository URL.
If you want to install Python packages from a repository that requires HTTP authorization, in the Authorization field, select Basic HTTP. Enter the login credentials.
Click OK to complete the task.
Install packages from the Version Control System
Click the Advanced Package Install button on the right side of the search bar.

In the dialog that opens, specify a path to the target Git repository.
For more information about supported path formats, refer to pip documentation.

Select Editable (-e) if you want to install the package in the editable mode (for example, setuptools develop mode).
Install packages from disk
Click the Advanced Package Install button on the right side of the search bar.

In the dialog that opens, specify a path to the package directory or an archive (zip or whl).

Select Editable (-e) if you want to install the package in the editable mode (for example, setuptools develop mode).
Upgrade packages
If a newer version of the package is available, the
Update button is displayed next to the package name. Click this button to upgrade the package to the latest version.

If a popup with an error message appears, refer to the Troubleshooting guide for a solution.
Uninstall packages
To delete an installed package, click the Uninstall package button next to the package name.

Manage packages in Project Structure settings
To manage Python packages for a project Python interpreter, go to or click the Python Interpreter selector and select Settings. If the project contains several subprojects, select the subproject in the list on the left. Then select the interpreter in the Interpreter list and switch to the Packages tab.
The Packages tab shows the packages of the interpreter selected in the Interpreter list. When you hover over a top-level package, the Change version and Uninstall package icons appear. The list also includes workspace members and module dependencies, which have no actions.
Install packages
On the Packages tab, click Install package… at the end of the Search packages field.
In the popup that opens, type the package name in the search field, or paste a URL or a path to a local package. To select a local package, click Browse for local package…. Then click Install.
If a popup with an error message appears, refer to the Troubleshooting guide for a solution.
Upgrade or downgrade packages
On the Packages tab, hover over the package and click Change version.
Select the version to install: a later version to upgrade the package or an earlier version to downgrade it.
Uninstall packages
On the Packages tab, hover over the package and click Uninstall package.
PyCharm uninstalls the package without asking for confirmation.
If you are accustomed to installing packages from the command line, you can proceed with your workflow using the Terminal.
Reuse installed packages
Create a new virtual environment and install packages that you want to be used in other projects. Then you can specify this virtual environment as a Python interpreter for the target project and all the needed packages will be available.
In the Terminal window execute the following command:
pip freeze > requirements.txtThen add the created
requirements.txtfile to the target project and PyCharm will prompt you to install the packages listed in the file.