on Windows
pip install virtualpip install virtualenvwrapper-win
on macOS / Linux
pip install --user virtualenvwrapperecho "source virtualenvwrapper.sh" >> ~/.bashrcsource ~/.bashrc
on Windows
Create a virtual environment to the specified directory and modify the twenty-four lines of the E:\python3.7.6\Scripts\mkvirtualenv.bat file as follows:
set "venvwrapper.default_workon_home=E:\python3.7.6\Envs"
mkvirtualenv --python=python3 myenv
on macOS/Linux
mkvirtualenv --python=python3.6 myenv
Set the workon environment variable, operation: environment variable --> system variable --> new: variable name: WORKON_HOME variable value: E:\python3.7.6\Envs
workon lists the virtual environment list
workon [myenv] switch environment
deactivate
rmvirtualenv myenv
1.pip freeze to view the current installed library version
Create a requirements.txt file that contains a simple list of all packages and their respective versions in the current environment
pip freeze > requirements.txt
2. Keep the deployment the same, install all packages with one click
pip install -r requirements.txt
3. List all environments
lsvirtualenv
4. Navigate to the directory of the currently activated virtual environment, equivalent to the pushd directory
cdvirtualenv
5. Similar to the above, go directly to the site-packages directory
cdsitepackages
6. Display the contents of the site-packages directory
lssitepackages
7. Download through the domestic Tsinghua mirror
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple