IntelliJ IDEA 2022.2 Help

Install, uninstall, and upgrade Python packages

IntelliJ IDEA provides methods for installing, uninstalling, and upgrading Python packages for a particular Python SDK. It means that each project has its own set of packages, which is considered a best practice for Python dependency management. By default, IntelliJ IDEA uses pip to manage project packages. For Conda environments you can use the conda package manager.

In IntelliJ IDEA, you can preview and manage packages in the Python Packages tool window and in the Python interpreter Settings/Preferences.

Manage packages in the Python interpreter settings

To manage Python packages for the Python interpreter, navigate to File | Project Structure, select SDKs under the Platform Settings section, and select the target Python SDK from the list of the available SDKs. Switch to the Packages tab to preview the list of the available packages.

Installing a Python package

If you select a Python SDK with the configured Conda environment, the Use Conda Package Manager toggle appears in the Packages tab toolbar.

Using the Conda package manager

Use this toggle to manage packages from the Conda environment repository. This toggle is enabled by default for Conda environments.

Install a package

  1. Click the Install a package button on the package toolbar.

    Add a package
    Add a package
  2. In the dialog that opens, preview the list of the available packages and type the name of the package to install in the Search field.

    Show available packages
  3. If required, select the following checkboxes:

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

    • 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 left cleared (by default), then the packages will be installed into the current interpreter package directory. If the checkbox is selected, the packages will be installed into the specified directory. This option is not available for Conda environments.

  4. Select the target package and click Install Package.

Uninstall a package

  1. In the Packages tab , select the packages to be removed.

  2. Click Uninstall (Uninstall a package). The selected packages are removed from disk.

IntelliJ IDEA smartly tracks the status of packages and recognizes outdated versions by showing the number of the currently installed package version (column Version), and the latest available version (column Latest version). When a newer version of a package is detected, IntelliJ IDEA marks it with the arrow sign New version is available and suggests to upgrade it.

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.

Show latest available versions including beta and release candidates

Upgrade a package

  1. In the Packages tab , select the package to be upgraded.

  2. Click Upgrade (Upgrade).

    Upgrading Python packages

    The selected packages are upgraded to the latest available versions.

  3. Click OK to complete upgrading.

If you're accustomed to installing packages from the commands line, you can proceed with your workflow using the Terminal.

Last modified: 16 September 2022