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
Table of contents 1. What is the life cycle 2. Th...
Table of contents 1. The significance of users an...
What if you designers want to use the font below ...
When programmers do TypeScript/JavaScript develop...
Preface The blogger uses the idea IDE. Because th...
app.js: startup file, or entry file package.json:...
Hi, everyone; today is Double 12, have you done a...
1. Make sure the network connection method is bri...
500 (Internal Server Error) The server encountere...
Web Services are concerned with application-to-ap...
1 Background Recently, some performance issues ha...
1. Install the built-in Linux subsystem of win10 ...
Currently implemented are basic usage, clearable,...
Table of contents Lifecycle Functions Common life...
Table of contents Preface advantage: shortcoming:...