For reference only for Python developers using Ubuntu 18.04
1. Install Ubuntu 18.04 virtual environment
sudo apt install virtualenv
sudo apt install virtualenvwrapper
After the installation is complete, enter the home directory, enter the command ls -al
to see if the .virtualenvs directory appears, if not, create the .virtualenvs directory manually
2. Install modules that can support virtual environments in the Python environment (I use Python 3.6 here)
pip3 install virtualenv
pip3 install virtualenvwrapper
3. Configure virtual management directory
Enter the home directory, enter the command ls -al, find the .bashrc file, and modify the .bashrc file
Add two lines at the end of the .bashrc file:
export WORKON_HOME=$HOME/.virtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
4. Enable profile
source ~/.bashrc
Use the mkvirtualenv project name to create a virtual environment. If it succeeds, the Ubuntu18.04 virtual environment is created successfully
PS: Let's take a look at Ubuntu 18.04 installation & creation of virtual environment
1. Install and configure the virtual environment
Install virtual environment
sudo apt install virtualenv
sudo apt install virtualenvwrapper
Configure the virtual management directory (ctrl + h in the home directory can open the hidden file, you can see .bashrc)
mkdir $HOME/.virtualenvs
export WORKON_HOME=$HOME/.virtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
Two enable configuration file
source ~/.bashrc
to sum up
The above is the Ubuntu 18.04 installation Python virtual environment introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
Recommended Posts