Project Structure
for Windows/Linux
for macOS
Ctrl+Alt+S
Use this page to configure the Python interpreter, the content roots, and the dependencies of the project, and to manage the packages of the interpreter. If the project contains several subprojects, select the subproject that you want to configure in the list on the left. This page is not available in the Settings for New Projects dialog.
Item | Description |
|---|---|
Auto-configure project workspace from pyproject.toml | When this checkbox is selected, PyCharm detects and configures subprojects from the pyproject.toml files of the project, and these files define the dependencies between the subprojects. The checkbox is selected by default. If you clear the checkbox and apply the change, PyCharm removes the subprojects that it has created from pyproject.toml files. |
Interpreter | Select the Python interpreter for the project or the selected subproject. To add an interpreter, click To view and manage all configured interpreters, select All interpreters… at the end of the list. The page opens. |
To apply the changes that you make on this page, including the Sources and Dependencies tabs, click Apply or OK. Package actions on the Packages tab run immediately.
Sources tab
Use this tab to configure the content roots of the project or the selected subproject.
Configure content roots
Item | Tooltip | Description |
|---|---|---|
| Sources | Mark a folder as a source root. PyCharm adds a source root to This command is duplicated from the context menu of a content root. |
| Excluded | Mark a folder as an excluded root. Usually, one would like to exclude temporary build folders, generated output, logs, and other project output. Excluding the unnecessary paths is a good way to significantly improve performance. This command is duplicated from the context menu of a content root. |
| Templates | Mark a folder as a template root, where all the directories, containing templates in the supported template languages, are stored. This command is duplicated from the context menu of a content root. |
| Resources | Click this button to mark a folder as a resource root, for the static contents such as CSS or JavaScript files. |
Add/remove content roots
Item | Tooltip | Description |
|---|---|---|
Add Content Root | Add a new root to the content roots . Click the button and navigate to the desired folder in the dialog that opens. | |
| Remove Content Entry | Delete selected content root from the project. |
| Unmark | Remove marking of a content root and denote it with a regular directory icon |
Dependencies tab
This tab is available only if the project contains several subprojects. Select the checkboxes next to the subprojects that the selected subproject depends on.
If the Auto-configure project workspace from pyproject.toml checkbox is selected, the pyproject.toml files define the dependencies, and you cannot change them on this tab.
Packages tab
This tab lists the packages installed for the selected interpreter. You can search for packages, install a package (Install package…), change the version of a package (Change version), and uninstall a package (Uninstall package).