IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Configure a Poetry environment

Last modified: 10 August 2022

Poetry is a tool that facilitates creating a Python virtual environment based on the project dependencies. You can declare the libraries your project depends on, and Poetry will install and update them for you.

Project dependencies are recorded in the pyproject.toml file that specifies required packages, scripts, plugins, and URLs. See the pyproject reference for more information about its structure and format.

To use Poetry in IntelliJ IDEA, you need to install it on your machine and create a specific Python environment.

When you configure a new Poetry environment, IntelliJ IDEA adds two files to your workspace:

  • pyproject.toml: specifies the project requirements

  • poetry.lock: records changes in the projects requirements

Each time you modify the pyproject.toml file, IntelliJ IDEA notifies you and offers two actions: to record the changes in the poetry.lock file or to record the changes and install the unsatisfied requirements.