Virtual environments
We oriented ourselves with respect to project creation in Chapter 2, Installation and Configuration; however, we glossed over the details around creating or setting up a virtual environment. Virtual environments are a feature of Python rather than of PyCharm. A virtual environment is a copy of a Python interpreter and its related files that is specific to a project. Most programming languages allow some way of segregating the requirements of one project from any other on your computer. At the outset of a project, you will typically create a virtual environment from your main, also called global, Python installation. The benefit comes when you are working on multiple projects with different requirements. It might be that one project requires Python 3.6, and the version is frozen there in order to comply with customer requirements around change control. Or maybe a library you need, such as matplotlib
, only runs in Python 3.6 on your Mac, but in Windows, it’...