The following is only valid when Python Plugin is installed and enabled!
IntelliJ IDEA makes it possible create virtual environment using the
virtualenv
tool. So doing, IntelliJ IDEA tightly
integrates with virtualenv, and enables configuring virtual environments right in
the IDE.
virtualenv tool comes bundled with IntelliJ IDEA, so the user doesn't need to install it.
- Open the Project Structure dialog (e.g. ⌘;⌘;⌘;⌃⌥⇧S⌃⌥⇧S).
- In the Project Structure dialog box, click SDKs node under the Platform Settings.
- Click
, and then choose Virtual environment from the
Add New SDK popup menu. - In the Create Virtual Environment dialog box, do the following:
- 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, or accept the suggested default location.
- 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 the desired base interpreter is missing in the drop-down list, you can locate it manually by clicking
. - If you want the
site-packagesof the base interpreter to be visible from the virtual environment, select the checkbox Inherit global site-packages. If you leave this checkbox cleared, the new virtual environment will be completely isolated.
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.