Login using Social Account
     Continue with GoogleLogin using your credentials
What is a Virtual Environment?
As the name suggests, it is an environment virtually created to isolate the projects.
This isolation helps to avoid discrepancies between the different versions of the libraries or packages as used by different projects in our system.
Why do we use a Virtual Environment?
How to create a Virtual Environment?
Creating a Virtual Environment: We create a python3 virtual environment with the name we mention using the following command:
virtualenv -p python3 <<your virtual environment name>>
Ex: virtualenv -p python3 my_first_venv creates a virtual environment named my_first_venv.
Activating a Virtual Environment: After creating the virtual environment, we switch to that environment to create our project and install the dependencies inside that environment. We switch to a virtual environment using the following command:
source <<your virtual environment name>>/bin/activate
Ex: source my_first_venv/bin/activate command switches to the virtual environment named my_first_venv.
Deactivating a Virtual Environment: To exit the environment, we just need to use the command:
deactivate
First, switch to Python 3
export PATH=/usr/local/anaconda/bin:$PATH
Now, create a virtual environment named Dead-Code-Sample
virtualenv -p python3 Dead-Code-Sample
Activate the virtual environment you created
source Dead-Code-Sample/bin/activate
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...