Install, uninstall, and upgrade packages | PyCharm (2024)

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 Python interpreter settings.

The Python Packages tool window provides the quickest and neat 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 Install, uninstall, and upgrade packages | PyCharm (1) Python Packages on the left. At any time you can open it using the main menu: View | Tool Windows | Python Packages.

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.

Install, uninstall, and upgrade packages | PyCharm (2)

You can preview the package documentation in the documentation area, or click the Documentation link and open it in a browser.

Install packages

  1. Start typing the package name in the search field of the Python Packages tool window. The matching packages are displayed.

    Install, uninstall, and upgrade packages | PyCharm (3)

    If the current Python interpreter is a conda virtual environment, the packages available in the conda package repository are also displayed.

  2. Select the package and then do one of the following:

    • Click Install next to the package name and choose the version.

      Install, uninstall, and upgrade packages | PyCharm (4)
    • Expand the list of the available versions and select the version. Then click the Install with pip or Install with conda button.

    Install, uninstall, and upgrade packages | PyCharm (5)
  3. If a popup with an error message appears, refer to the Troubleshooting guide for a solution.

Manage package repositories

  1. To specify a custom repository, for example devpi or a private PyPi server, click Install, uninstall, and upgrade packages | PyCharm (6) Settings next to the search field.

  2. In the Python Packages Repositories dialog, click Install, uninstall, and upgrade packages | PyCharm (7) Add. If no authorization is required, for example, in the case of a local repository, type the repository URL and click OK.

    Install, uninstall, and upgrade packages | PyCharm (8)
  3. If you want to install Python packages from a repository that requires HTTP authorization, click Basic HTTP and type the repository URL and the login credentials. Click OK to complete the task.

    Install, uninstall, and upgrade packages | PyCharm (9)

Install packages from Version Control System

  1. Click the Add Package link on the Python Packages toolbar and select From Version Control.

  2. Specify a path to the target git repository. For more information about supported path formats, refer to pip documentation.

    Install, uninstall, and upgrade packages | PyCharm (10)
  3. Select Install as editable (-e) if you want to install the package in the editable mode (for example, setuptools develop mode).

Install packages from disk

  1. Click the Add Package link on the Python Packages toolbar and select From Disk.

    Install, uninstall, and upgrade packages | PyCharm (11)
  2. Specify a path to the package directory or an archive (zip or whl).

  3. Select Install as 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, a link with the current version and the newest version is displayed next to the package name. Click the link to upgrade the package to the latest version.

    Install, uninstall, and upgrade packages | PyCharm (12)

    If a popup with an error message appears, refer to the Troubleshooting guide for a solution.

Uninstall packages

  • To delete an installed package, click Install, uninstall, and upgrade packages | PyCharm (13) More next to the package version and select Delete Package.

    Install, uninstall, and upgrade packages | PyCharm (14)

Manage packages in Python interpreter settings

To manage Python packages for a project Python interpreter, go to Settings | Project: <project_name> | Python Interpreter or select Interpreter Settings in the Python Interpreter selector. Then select the interpreter in the Python Interpreter field.

Install, uninstall, and upgrade packages | PyCharm (15)

Install packages

  1. Click the Install, uninstall, and upgrade packages | PyCharm (16) Install on the toolbar.

    Install, uninstall, and upgrade packages | PyCharm (17)
  2. In the Available Packages dialog that opens, type the name of the package in the search field.

    Install, uninstall, and upgrade packages | PyCharm (18)
  3. If required, select the following checkboxes:

    • Specify version: if this checkbox is selected, you can select the desired version from the list. By default, the latest version is installed.

    • Options: If this checkbox is selected, you can type the pip install command-line options in the text field.

    • Install to user's site packages directory <path>: If this checkbox is disabled (by default), the package will be installed into package directory of the current interpreter. If the checkbox is enabled, the package will be installed into the mentioned directory. This option is available only for conda environments.

  4. Select the package and click Install Package.

  5. If a popup with an error message appears, refer to the Troubleshooting guide for a solution.

Install packages from conda package repository

  • If you select a Python interpreter with the configured conda environment, the Use Conda Package Manager toggle appears in the packages area toolbar.

    Install, uninstall, and upgrade packages | PyCharm (19)

    Use this toggle to install and upgrade packages from the conda package repository. This toggle is enabled by default for conda environments.

Uninstall packages

  1. In the list of packages, select the packages to be uninstalled.

  2. Click Install, uninstall, and upgrade packages | PyCharm (20) Uninstall on the toolbar.

    Install, uninstall, and upgrade packages | PyCharm (21)

PyCharm tracks the status of packages and recognizes outdated versions by showing the currently installed package version (column Version), and the latest available version (column Latest version). When a newer version of a package is detected, PyCharm marks it with the Install, uninstall, and upgrade packages | PyCharm (22) Upgrade icon.

By default, the Latest version column shows only stable versions of the packages. If you want to extend the scope of the latest available versions to any pre-release versions (such as beta or release candidate), click Show early releases.

Install, uninstall, and upgrade packages | PyCharm (23)

Upgrade packages

  1. In the list of packages, select the package to be upgraded.

  2. Click Install, uninstall, and upgrade packages | PyCharm (24) Upgrade on the toolbar.

    Install, uninstall, and upgrade packages | PyCharm (25)

    The selected package will be upgraded to the latest available version.

  3. Click OK to complete upgrading.

If you're 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.txt

    Then add the created requirements.txt file to the target project and PyCharm will prompt you to install the packages listed in the file.

Last modified: 05 April 2024

Configure an interpreter using command lineManage interpreter paths

Install, uninstall, and upgrade packages | PyCharm (2024)
Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 6430

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.