Create a virtual environment in Python are quite useful if you need to test and install libraries that may conflict with libraries from other projects. They allow you to isolate an environment and test safely. Creating a virtual environment in Python is easy and we will show you how to do it.
On Linux Ubuntu
To create a virtual environment in Python or virtual environment, you can use this command on Linux:
python3 -m venv /local_path/venv
Later, if you want to use it:
To create a virtual environment on Windows first make sure you have virtualenv installed:
pip install virtualenv
To create a virtual environment you must go to the folder where you want the environment to be created.
Later you create the environment or environment with the following command:
Finally activate the environment:
Once you have activated the environment, the prompt in your terminal will change using the name of the virtual environment.