The Python virtualenv
Install VirtualEnv2.1 Install Virtualenv2.2 Create virtual Environment 2.3 Activate/exit virtual Environment
3. TIps
1. What is VirtualEnv
Virtualenv is short for Virtual Environment, meaning a virtual environment.
so what’s good about python using it?Some!
suppose I did A project A before, using Django2.2. Now that there is a new version of Django3.1, I want to use the latest version of Django. The problem is that I installed the new version of Django, and project A using the old version may not run smoothly.
this is where virtualenv comes in. It can create multiple virtual environments simultaneously, allowing multiple versions of Django to exist on a single computer.
2. Install VirtualEnv
2.1 install virtualenv
pip install virtualenv
2.2 Create a virtual environment
Create a virtual environment.
command format:
virtualenv+ environment name
virtualenv test_env1
virtualenv test_env2
2.3 Activate/exit the virtual environment
Enter the virtual environment, and then you can install the package in the virtual environment.
Win:
Run\Scripts\activate access a virtual environment
Run\Scripts\deactivate exit a virtual environment
3. TIps
There is no package installed in the virtual environment and a re-pip is required. The Python interpreter is in the /Scripts/ Python.exe directory.
Read More:
- Virtual environment: error: virtualenv is not compatible with this system or executable
- Error in installing virtualenv
- Can’t find Python executable “D:\python3\python.exe”, you can set the PYTHON env variable.
- Solve the problem of unable to locate package python3.6 when upgrading from python3.5 to python3.6 in ubantu16.04
- Python – writing visual interface (Python + pycharm + pyqt)
- yarn install gyp verb `which` failed python2 Error: not found: python2
- The python version output from the command line is inconsistent with the python version in the current CONDA environment
- Learning notes of Python 3: debugger speedups using Python not found
- Python Basics – python3 installing pyhook and pywin32 Libraries
- Python – [encoding] in Python os.system Solution to Chinese garbled code when calling CMD command
- KeyError: ‘/home/xxx/anaconda3/lib/python3.8/site-packages/parso/python/grammar38.txt‘
- Pychar reported an error. Unable to set the python SDK in Python 3.8. This SDK appears to be invalid.
- Anaconda returns Python 3.7 to Python 3.6
- Python module learning-Paramiko-Use python to throw an exception: Authentication failed.
- Encountered a problem — Python — Python 3 uses Sqlalchemy to report an error‘
- Error loading Python DLL ‘python36.dll’. LoadLibrary: The specified module could not be found.
- Cannot set up a python SDK Python 2.7. The SDK sees invalid
- Configuration (9) to solve the problem of “setup tools PIP wheel failed with error code 1”, create virtual environments with Python of anaconda
- The solution to the error of importing CSV from Python to Python
- Installation of Python on MAC