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
Install Enter the following command to install it...
KDE Abbreviation for Kool Desktop Environment. A ...
1. Check whether MySQL is installed yum list inst...
What are the shutdown commands for Linux systems?...
1. Download the installation package from the off...
Table of contents Some basic instructions 1. Chec...
Preface innodb_data_file_path is used to specify ...
Written in front In recent years, the live stream...
Table of contents Easy to use Create a project vu...
Preface: This article mainly introduces the conte...
Basically all e-commerce projects have the functi...
Hyperlink, also called "link". Hyperlin...
1. Problem description: MysqlERROR1698 (28000) so...
1. To optimize the query, try to avoid full table...
This article example shares the specific code for...