![Sketchbook pro app](https://cdn3.cdnme.se/5447227/9-3/1_64e61dfaddf2b33c615a3cd3.png)
![virtualenv python3 virtualenv python3](https://i.stack.imgur.com/HjUri.png)
Source funProjectDependencies/bin/activate On many systems like the CSE machines, python calls to Python2, which is not the version we want for this course. Note: Leaving out the flag -python=python3 in the above commands will setup the venv for the version of Python that is called by python, if it exists. This will create all the executables in the current directory but it is always recommended to create a separate folder as it keeps everything organised. If you don’t want to create a new folder inside your project to store the virtual environment, then you can instead run: This will create a new folder in the current directory with Python3 executable files and a copy of the pip3 library so that you can install new packages in the environment. Virtualenv -python=python3 funProjectDependencies Now, let’s create a new virtual environment (venv) for Python3. This folder will ideally host all you project files. Okay, we’ve created a new folder and we are inside it. But before that, let’s create a folder to put the environment details inside. Now that you’ve ensured that virtualenv is installed on your system, we can move on to creating our first virtual environment. In Python, we use virtualenv to create a virtual environment. You can have as many different virtual environments on your machine as you want but it is important to keep track of where they are and what you name them.
![virtualenv python3 virtualenv python3](https://storage.googleapis.com/static.configserverfirewall.com/images/ubuntu/create-python-virtualenv.png)
Note that, v2 will still be your default version of that package but you’ll be able to use v1 in your virtual environment.
![virtualenv python3 virtualenv python3](https://i.stack.imgur.com/pj9qb.png)
Regardless of what your global setup looks like, you can create a virtual environment for your project and use package v1.
![virtualenv python3 virtualenv python3](https://i.stack.imgur.com/vakFI.png)
For example, you might have package v2 installed on your machine but one of your projects depends on v1 of the same package. Virtual environments in Python allow you to have different versions of packages and libraries for different projects you work on regardless of your global setup. Virtual Environments in Python What is Virtual Environment?
![Sketchbook pro app](https://cdn3.cdnme.se/5447227/9-3/1_64e61dfaddf2b33c615a3cd3.png)