The following are all performed on my virtual machine 1. Install pip3
2. Install the virtual environment sudo apt install virtualenv sudo apt install virtualenvwrapper 3. Modify the configuration file to set environment variables
Add the following two lines to the end of the .bashrc file export WORKON_HOME=$HOME/.virtualenvs source /usr/share/virtualenvwrapper/virtualenvwrapper.sh The sentence "usr/share/virtualenvwrapper/virtualenvwrapper.sh" is different from other Ubuntu versions. For example, on Ubuntu 18.04, it is "source /usr/local/bin/virtualenvwrapper.sh". You can find the specific file location yourself and fill it in sudo find / -name virtualenvwrapper.sh 4. Enable the configuration file source .bashrc At this point, you can create a virtual environment normally. PS: Let's take a look at Python3 to create a virtual environment Purpose Use virtual environments to isolate Python libraries between different projects Creating a Virtual Environment Python3 has a built-in venv module. First, create a project directory, enter the directory, and execute
Activate the virtual environment Before starting work, activate the corresponding virtual environment:
On Windows:
Once activated, your terminal prompt will display the name of the virtual environment. Install the corresponding modules, such as:
Summarize This is the end of this article about installing Python 3 virtual environment in Ubuntu 20.04. For more information about installing Python 3 virtual environment in Ubuntu 20.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to use not in to optimize MySql
>>: Vue implements file upload and download
Core code <!DOCTYPE html> <html lang=&qu...
Create a user: create user 'oukele'@'...
This article example shares the specific code of ...
Margin of parallel boxes (overlap of double margi...
MySQL 8.0.22 download, installation and configura...
The code can be further streamlined, but due to t...
URL rewriting helps determine the preferred domai...
As the company's influence grows and its prod...
During this period of time, I was studying docker...
This article uses examples to describe the creati...
Table of contents Preface 1. Null coalescing oper...
Table of contents 1. Observable 2. Higher-order f...
Table of contents 1. JavaScript uses canvas in HT...
About the tree display of Vue, the project is use...
Prepare: Define a teacher table and a student tab...