1. Virtual environment follows the project, create a virtual environment for a single project (Python 3.4 and above come with built-in virtualenv, pip install virtualenv) 1. Create a project directory: (find a directory) mkdir PythonProject cd PythonProject 2. Create a virtual environment env: python -m venv env 3. Activate the virtual environment: source env/bin/acticate 4. Install the package and create a py file 5. Exit the virtual environment: deactivate 2. Virtaulenvwrapper Virtaulenvwrapper is an extension package of virtualenv, which is used to facilitate the management of virtual environments Integrate all virtual environments into one directory 1. Installation: 2. Create a virtual environment storage directory: 3. Add in ~/.bashrc: 4. Run: source ~/.bashrc List the virtual environment list: workon Create a new virtual environment: mkvirtualenv Switch virtual environment: workon [virtual environment name] Delete a virtual environment: rmvirtualenv Exit the virtual environment: deactivate: Use parameters: (All third-party packages that have been installed in the system Python environment will not be copied) 5. Create a virtual environment based on the Python version Query Python path: which python , whereis python mkvirtualenv -p /xx/xx/python env_name mkvirtualenv -p /usr/bin/python f Summarize The above is what I introduced to you about using venv in python3 to create a virtual environment in Ubuntu. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of MySQL index principles and optimization
>>: Detailed explanation of the principle and example of the new operator in JavaScript
If you set the table-layer:fixed style for a tabl...
Because Ubuntu 20.04 manages the network through ...
Now there are many WeChat public account operatio...
Table of contents Preface The value of front-end ...
Recently I saw the article Build your own React o...
To deploy war with Docker, you must use a contain...
Use canvas to create graphics and text with shado...
Every time you log in to the test server, you alw...
1. Installation Tip: There is currently no offici...
The blogger said : I have been writing a series o...
Recently, I was adding a series of statistical fu...
1. Command method Run the nginx service in the cr...
Table of contents Configure node.js+nvm+npm npm s...
Main differences: 1. Type SQL databases are prima...
Preface To put it simply, tcpdump is a packet ana...