PyCharm
 
Get PyCharm

Configure a virtualenv environment

Last modified: 23 January 2025

PyCharm makes it possible to use the virtualenv tool to create a project-specific isolated virtual environment. The main purpose of virtual environments is to manage settings and dependencies of a particular project regardless of other Python projects. virtualenv tool comes bundled with PyCharm, so the user does not need to install it.

You can create as many virtual environments as required. To easily tell them from each other, use different names.

PyCharm can create a virtual environment for your project based on the project requirements.

This approach is particularly helpful when you want to upgrade a version of Python your environment is based on, for example, from 3.5 to 3.9. You can specify a new base interpreter and use requirements.txt to ensure all the necessary packages are installed.

For any of the configured Python interpreters (but Docker-based), you can:

Once you have created a new virtual environment, you can reuse it for your other projects. Learn more how to set up an existing environment as a Python interpreter.