A Python project can have its own Python version and installed packages. In PyCharm 2026.3 on the Linux desktop, you can set the project's Python interpreter to an existing virtual environment so that project runs use those packages.
A virtual environment has a Python executable under its own bin directory. Even when it uses the same Python version as the system installation, its executable gives the project access to packages installed in that environment.
A run configuration can specify its own interpreter. Running the current Python file from the editor gives you a way to check the project interpreter without relying on a configuration that may point elsewhere.
Steps to set a project's Python interpreter in PyCharm:
Start with a trusted local project open in PyCharm, Current File selected in the Run widget, and a Python file open that imports a package from the environment you want to use and produces output after the import. The pictures show forecast.py in ~/PycharmProjects/forecast and an environment named forecast-env under ~/Documents. Only run code from a project and environment you trust, since PyCharm executes the script and the code it imports.
If PyCharm shows the Air landing page or a Junie offer when you open the project, you can leave them alone and open your Python file from the Project tool window before step 1.
- Press
Ctrl+Alt+Sto open Settings.
- Select Project Structure in the Settings sidebar.

- Click the plus button beside Interpreter.

- Select Add Local Interpreter… from the menu.

- Choose Select existing under Environment in Add Python Interpreter.

- Click the folder icon beside Python path.

- Enter the full path to your virtual environment's
bin/pythonin the chooser's path field, replacing the existing path.
The sample path is
/home/reader/Documents/forecast-env/bin/python. - Click OK in Select Python Interpreter.

- Press
Enterin Add Python Interpreter to accept the selected executable.
- Press
Tabuntil the Auto-configure project workspace from pyproject.toml checkbox has keyboard focus once Interpreter shows your environment.
A blue outline around the checkbox shows keyboard focus.
- Press
Enterto save the project interpreter.
- Click the green Run triangle beside Current File to run your open Python file.

- Check that the first path in the Run tool window matches the
bin/pythonexecutable you selected.
- Check that Run shows the expected output from your script after the import.
The sample prints
colorama.__file__, which ends insite-packages/colorama/__init__.pyinsideforecast-env. An import error means the run did not load the package.