Как обновить python в pycharm
Перейти к содержимому

Как обновить python в pycharm

  • автор:

Configure a system interpreter

To work with your Python code in PyCharm, you need to configure at least one interpreter. A system interpreter is the one that comes with your Python installation. You can use it solely for all Python scripts or take it as a base interpreter for Python virtual environments.

Configure a system interpreter

  1. Ensure that you have downloaded and installed Python on your computer. Installing Python on Windows from Microsoft Store If you are on Windows, you can download Python from the Microsoft Store and install it as a Python interpreter. Once the Python application is downloaded from the Microsoft Store, it becomes available in the list of the Python executables. Note that interpreters added from the Microsoft Store installations come with some limitations. Because of restrictions on Microsoft Store apps, Python scripts may not have full write access to shared locations such as TEMP and the registry.
  2. Do one of the following:
    • Click the Python Interpreter selector and choose Add New Interpreter .
    • Press Ctrl+Alt+S to open Settings and go to Project: | Python Interpreter . Click the Add Interpreter link next to the list of the available interpreters.
    • Click the Python Interpreter selector and choose Interpreter Settings . Click the Add Interpreter link next to the list of the available interpreters.
  3. Select Add Local Interpreter .
  4. In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter . Adding a system interpreter
  5. In the Interpreter drop-down, select one of the Python interpreters that have been installed in your system, or click and in the Select Python Interpreter dialog that opens, choose the desired Python executable. Selecting the Python executableYou will need admin privileges to install, remove, and upgrade packages for the system interpreter. When attempting to install an interpreter package through an intention action, you might receive the following error message: System Interpreter warning messageAs prompted, consider using a virtual environment for your project.
  6. Click OK to complete the task.

For any of the configured Python interpreters (but Docker-based), you can:

  • Manage interpreter paths
  • Install, uninstall, and upgrade packages

Last modified: 11 February 2024

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

Manage packages in the Python Packages tool window

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 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.

Python Packages tool window

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. Search for the package in the Python Packages tool windowIf 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. Installing the package from the search results
    • Expand the list of the available versions and select the version. Then click the Install with pip or Install with conda button.

    Selecting the package version to be installed

  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 Settings next to the search field.
  2. In the Python Packages Repositories dialog, click Add . If no authorization is required, for example, in the case of a local repository, type the repository URL and click OK . Adding a Python repository: No Authorization
  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. Adding a Python repository: Basic HTTP Authorization

Install packages from Version Control System

Install from Version Control

  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.
  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

Install package from disc

  1. Click the Add Package link on the Python Packages toolbar and select From Disk .
  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

A newer version of the package is available

  • 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. If a popup with an error message appears, refer to the Troubleshooting guide for a solution.

Uninstall packages

Uninstalling a package in the Python Packages tool window

  • To delete an installed package, click More next to the package version and select Delete Package .

Manage packages in Python interpreter settings

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

Viewing the installed Python packages

Install packages

  1. Click the Install on the toolbar. Add a package
  2. In the Available Packages dialog that opens, type the name of the package 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. 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 : 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

Using the Conda package manager

  • If you select a Python interpreter with the configured conda environment, the Use Conda Package Manager toggle appears in the packages area toolbar. Use this toggle to install and upgrade packages from the conda package repository. This toggle is enabled by default for conda environments.

Uninstall packages

Uninstalling a Python package

  1. In the list of packages, select the packages to be uninstalled.
  2. Click Uninstall on the toolbar.

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 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 .

Show latest available versions including beta and release candidates

Upgrade packages

Upgrading Python packages

  1. In the list of packages, select the package to be upgraded.
  2. Click Upgrade on the toolbar. The selected package will be upgraded to the latest available version.
  3. Click OK to complete upgrading.

You can upgrade several packages at once. Hold Cmd (macOS) or Ctrl on (Unix or Windows), left-click to select several items in the list of packages, and then click Upgrade .

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.

How to change version of Python in PyCharm

I wanted to make Discord bot (should I even write this here), but it’s said that I need Python 3.6, not Python 3.7 that I have. How can I change from Python 3.7 to Python 3.6 to make something like that ?

187k 19 19 gold badges 139 139 silver badges 256 256 bronze badges
asked Aug 26, 2018 at 23:20
939 2 2 gold badges 8 8 silver badges 16 16 bronze badges

you just need to change the Python Interpreter used for the project. Edit configurations/Python interpreter.

Aug 26, 2018 at 23:22
. and install Python 3.6 if it’s not already done
Aug 26, 2018 at 23:25
how does one downgrade pycharm version?
Aug 17, 2022 at 13:49

2 Answers 2

First make sure you have Python 3.6 installed.

Then Go to File > Settings > Project:* > Project Interpreter , then select your interpreter under the Project Interpreter drop down.

enter image description here

If its still not there, you can also press the settings cog button on the right side of the drop down and select add . Select System Interpreter from the left side, then select the interpreter from there. When you press ok , the interpreter will be available to be selected.

Python

If you are a Windows user, we recommend that you install Python for Windows.

Supported versions

  • Python 2: version 2.7
  • Python 3: from the version 3.6 up to the version 3.12

The following features are available as part of Python 3.12 support:

  • PPEP 695 – Type Parameter Syntax
  • PEP 669 – Low Impact Monitoring for CPython
  • PEP 701 – Syntactic formalization of f-strings
  • PEP 698 – Override Decorator for Static Typing

The following features are available as part of Python 3.11 support:

  • PEP 673 – Self Type
  • PEP 646 – Variadic Generics
  • PEP 654 – Exception Groups and except*
  • PEP 655 – Marking individual TypedDict items as required or potentially-missing

The following features are available as part of Python 3.10 support:

  • PEP 647 – User-Defined Type Guards
  • PEP 604 – Allow writing union types as X | Y
  • PEP 612 – Parameter Specification Variables
  • PEP 613 – Explicit Type Aliases
  • PEP 634 – Structural Pattern Matching: Specification
  • PEP 635 – Structural Pattern Matching: Motivation and Rationale
  • PEP 636 – Structural Pattern Matching: Tutorial

The following features are available as part of Python 3.9 support:

  • PEP 585 – Type Hinting Generics In Standard Collections
  • PEP 593 – Flexible function and variable annotations
  • PEP 614 – Relaxing Grammar Restrictions On Decorators

The following features are available as part of Python 3.8 support

  • PEP-570 – Python Positional-Only Parameters
  • PEP-572 – Assignment Expressions
  • PEP-586 – Literal Types
  • PEP-589 – TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys
  • PEP-591 – Adding a final qualifier to typing
  • Python bug tracker task #36817 – Support = expressions in f-strings

PyCharm integrates the following features of Python 3.7:

  • PEP-561 – Distributing and Packaging Type Information
  • PEP-544 – Protocols: Structural subtyping (static duck typing)
  • PEP-557 – Data Classes
  • PEP-560 – Core support for typing module and generic types
  • PEP-562 – Module __getattr__ and __dir__
  • PEP-563 – Postponed Evaluation of Annotations

Python support in PyCharm

PyCharm provides the following features to help you work with Python:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *