Python ide intellij idea

Python language support

The following is only valid when the Python plugin is installed and enabled.

To develop Python scripts in IntelliJ IDEA:

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
  • 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
  • PEP 585 – Type Hinting Generics In Standard Collections
  • PEP 593 – Flexible function and variable annotations
  • PEP 614 – Relaxing Grammar Restrictions On Decorators
  • 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

Python support in IntelliJ IDEA

IntelliJ IDEA provides the following features to help you work with Python:

  • Dedicated module type.
  • Ability to configure interpreters. .
  • Python console .
  • Run/debug configurations for Python, and Python remote debug.
  • Code insight
  • Code inspections.
  • Intention actions.
  • Code completion and resolve.
  • Built-in code formatter and separate set of Python code style settings.
  • Find usages in Python code.
  • Testing frameworks.
  • Quick documentation.
  • Recognizing Python documentation comments .
  • Configuring Python debugger.
  • UML Class diagram for Python classes.
Читайте также:  Http hella code poisk html

Источник

Python

The following is only valid when the Python plugin is installed and enabled.

Python Plugin extends IntelliJ IDEA with the full-scale functionality for Python development.

Prerequisites

Before you start working with Python, make sure that Python plugin is installed and enabled. Press Ctrl+Alt+S , go to Plugins and inspect the Installed tab to ensure the plugin is enabled.

Also make sure that the following prerequisites are met:

  • Python SDK is downloaded and installed on your machine.
  • The required framework SDKs are downloaded and installed on your machine.

Refer to their respective download and installation pages for details:

Changes to the UI

Being installed, the Python Plugin introduces the following changes to the IntelliJ IDEA UI:

  • Python module type is added to the New Project and New Module wizards. Creating a new Python project
  • Python file type is added to the File | New menu. The Python file, Python unit test, and Python stub file types are available. Creating a new Python file
  • Python SDK can be specified in the Add new SDK popup under the SDKs node of the Project Structure dialog. Adding a Python SDK
  • Django and Google App Engine (Python) are implemented as the facets, which can be attached to a Python module, either in the New Project dialog, or in the Modules or facets pages of the Project Structure dialog:

facets

modules

Python-related options in the Tools menu

  • Python-related commands are added to the Tools menu:
  • Python and framework-specific run/debug configurations, inspections, intention actions, and refactorings.
  • Besides that, the following changes are made to the Settings dialog:

    • Python code style, colors and fonts, live templates.
    • Python Debugger is added under the Build, Execution, Deployment node.
    • Python-related options add to the Stepping page.
    • Python console pages are added.
    • Syntax and error highlighting
    • More Python-specific options are added to the Coverage page.
    • Python Template Languages , Python External Documentation, Python Integrated Tools, and Python Scientific pages are added.
    • The Scientific Mode option is added to the View menu.
    Читайте также:  Php читать файл массив

    Источник

    Create a Python project

    The following is only valid when the Python plugin is installed and enabled.

    1. Ensure that the Python plugin is installed and enabled.
    2. From the main menu, choose File | New | Project or on the Welcome screen , click New Project .
    3. In the New Project dialog, select Python as a project type. New Python project: existing interpreterIf you have any configured Python environments, select one from the list, or click The Browse buttonand specify a path to the target environment.
    4. If no environment is available, select the New button and choose the environment type:

    Create a new venv environment

    • Specify the location of the new virtual environment in the Location field, or click and browse for the desired location in your file system. The directory for the new virtual environment should be empty.
    • Choose the base interpreter from the list, or click Choose the base interpreterand find the desired Python executable in your file system.
    • Select the Inherit global site-packages checkbox if you want all packages installed in the global Python on your machine to be added to the virtual environment you’re going to create. This checkbox corresponds to the —system-site-packages option of the virtualenv tool.
    • Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in IntelliJ IDEA.

    Create a new conda environment

    • Specify the location of the new conda environment in the Location field, or click Conda environment locationand browse for the desired location in your file system. The directory for the new conda environment should be empty.
    • Select the Python version from the list.
    • Normally, IntelliJ IDEA will detect conda installation. Otherwise, specify the location of the conda executable, or click Conda executable locationto browse for it.
    • Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in IntelliJ IDEA.

    Create a new pipenv environment

    • Choose the base interpreter from the list, or click Choose the base interpreterand find the desired Python executable in your file system.
    • If you have added the base binary directory to your PATH environmental variable, you don’t need to set any additional options: the path to the pipenv executable will be autodetected. If the pipenv executable is not found, follow the pipenv installation procedure to discover the executable path, and then paste it in the Pipenv executable field.

    Create a new venv environment

    • Choose the base interpreter from the list, or click Choose the base interpreterand find the desired Python executable in your file system.
    • If IntelliJ IDEA doesn’t detect the poetry executable, specify the following path in the Poetry executable field, replacing jetbrains with your username:

    Источник

    Оцените статью