PyCharm makes it possible create virtual environment using the virtualenv tool. So doing, PyCharm tightly integrates with virtualenv, and enables configuring virtual environments right in the IDE.
virtualenv tool comes bundled with PyCharm, so the user doesn't need to install it.
- Open the project settings, and click Python Interpreters page.
- Click in the toolbar.
Create New Virtual Environment dialog box opens.
- In the Create New Virtual Environment dialog box:
- In the Name field, type the name of the new virtual environment, or accept the suggested default name.
- In the Location field, specify the target directory, where the new virtual environment will be created.
- From Base interpreter drop-down list, select one of the configured Python interpreters, which will be used as the base for the new virtual environment.
- If you want the site-packages of the base interpreter to be visible from the virtual environment, select the check box Inherit global site-packages. If you leave this check box cleared, the new virtual environment will be completely isolated.
If you want to assign the new virtual environment to be the project interpreter, make sure that the corresponding check box is selected.
Also, you can make this virtual environment available to all projects, same as when an existing virtual environment is added.
Click OK to apply changes and close the dialog box.
You can create as many virtual environments as required. To easily tell them from each other, use different names.