Virtual Environment is necessary when you have many projects with different requirements, You can use python2 or python3 without worrying about collision and keep then main python folder clean
Install python virtual environment
>> sudo apt-get install updates
>> sudo apt-get install python3-venv
Create project folder
>> mkdir project_folder_name
>> cd project_folder_name/
Initialize a virtual environment
>> python3 -m venv virtual_env_name
To activate virtual_env
>> source virtual_env_name/bin/activate
To deactivate virtual_env
>> deactivate
Top comments (0)