Use pyproject.toml
You can specify the project dependencies in the pyproject.toml file inside the project directory. You can create pyproject.toml manually or configure a Poetry environment, so that it's created automatically.
PyCharm provides code completion for packages names and a quick-fix to install the missing dependencies.
Specify project dependencies
Open pyproject.toml in the editor.
Locate or create the
[project]section.Specify the names of the required packages as strings in the
dependenciesarray.When you start typing the package name, PyCharm provides completion options:

Press Enter to insert the suggestion.
You can also provide the optional dependencies of the project in the [project.optional-dependencies] section or specify the build-time dependencies in [build-system.requires].
If the name of the package is highlighted, it means that this package has not been installed for the current Python interpreter.
Install missing packages
Place the caret at the highlighted package name and press Alt+Enter.
Click Install package.

Update .lock file
Open pyproject.toml in the editor.
Edit pyproject.toml to add, remove, or change a dependency.
If the .lock file becomes outdated, the popup with available actions appears in the upper-right corner of the editor. If it is not visible, hover over the area to reveal the popup.
The available actions depend on the type of environment:
Poetry Lock: Update the poetry .lock file to match the dependencies in pyproject.toml.

Poetry Update: Install or update dependencies based on pyproject .toml and update the poetry.lock file accordingly.

For more information, refer to Poetry documentation.
uv Lock: Upgrade all dependencies to the latest allowed versions and update the uv.lock file.

uv Sync: Update the project's environment to ensure that all dependencies are up to date with the uv.lock file.

For more information, refer to uv documentation.
Hatch Run: Run the default Hatch environment to install or update packages based on pyproject.toml. If any dependencies have changed, the environment is automatically updated to reflect those changes.

For more information, refer to Hatch documentation.