I don't know if we can force a project to use a specific before configuring it first. PyCharm auto detects available interpreters and we will have to configure the project to use a specific interpreter and give it a name.
The following is from the Help docs from PyCharm:
PyCharm helps assign a Python interpreter for a project.
So doing, each one of the projects, opened in the same window, can have an interpreter of its own, selected from the list of available interpreters.
Note that PyCharm stores only the interpreter name in the project settings.
To configure Python SDK for the current project, follow these steps:
- Open the Settings/Preferences dialog box, and click Project Interpreter page.
- In the Projects pane, choose the desired project.
- Choose SDK from the list of available Python interpreters and virtual environments.
This list includes:
- Python interpreters, which reside in standard locations.
- Virtual environments, which reside under the project folder, or under the folder specified as an environment variable WORKON_HOME.
- Other Python interpreters, installed locally or remotely.
- If the desired interpreter is not in the list, click the cogwheel icon, and configure the desired interpreter as described in the section Configuring Available Python Interpreters.