![]() ![]() ![]() To deactivate the environment use the deactivate command. To create a virtual environment in Python3 and activate it immediately use this command in your terminal: mkvirtualenv name_of_your_env Now you need to reload the bashrc script, there are two ways of doing it: close and reopen your terminal or execute source ~/.bashrc command usr/local/bin/virtualenvwrapper.shĪfter you are done, press the esc key then type:wq and press enter, this command will save and exit the Vim editor. bashrc file, press the letter i to enter the insert mode of Vim and add these rows: #Virtualenvwrapper settings: export WORKON_HOME=$HOME/.virtualenvs VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3. sudo apt install vimĪfter you installed Vim open the file. It is one of the widely used Linux editors and for a good reason. ![]() If you still haven’t used Vim editor or you don’t have it installed on your computer you should install it now. We will point virtual environments to the directory we created above (.virtualenv) and we will also point to the locations of the virtualenv and virtualenvwrapper. bashrc file by adding a row that will adjust every new virtual environment to use Python 3. Install virtualenvwrapper via pip3: pip3 install virtualenvwrapper Bashrc file It provides commands like mkvirtualenv, lssitepackages, and especially workon for switching between different virtualenv environments. Virtualenvwrapper is a set of extensions to virtualenv. sudo apt install python3-pipĬonfirm the pip3 installation. You first need to create a special directory that will hold all of your virtual environments so proceed with creating a new hidden directory called virtualenv. Now open your terminal in the home directory by right clicking and choosing the option “Open in Terminal” or you can press the CTRL, ALT, and T keys on your keyboard at the same time to open the Terminal application automatically. To complete this tutorial you will need a computer with Ubuntu 20.04 installed and a internet connection :) Also some knowledge in terminals and Vim editor would be useful. We are not doing it anymore with Python 2 because at this moment Python 2 is dead : In this text I will show you how to set up virtualenvwrapper with pip3 (pip for Python 3). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |