Skip to content

Instantly share code, notes, and snippets.

@dongzhuoyao
Forked from whhone/virtualenvwrapper.md
Last active September 11, 2023 19:22
Show Gist options
  • Save dongzhuoyao/b4314b712f79d27a67183523066b44ed to your computer and use it in GitHub Desktop.
Save dongzhuoyao/b4314b712f79d27a67183523066b44ed to your computer and use it in GitHub Desktop.
virtualenvwrapper Cheat Sheet

local setting

PATH=$PATH:~/.local/bin
source /home/tao/.local/bin/virtualenvwrapper.sh
pip install virtualenvwrapper --user #make everything locally!!

vim, zsh is very hard to install locally without sudo permission.

zsh修改:

export PATH="/home/hut/miniconda3/bin:$PATH"
export VIRTUALENVWRAPPER_PYTHON="/usr/bin/python2"
source "/usr/local/bin/virtualenvwrapper.sh"   
maybe /usr/share/virtualenvwrapper/virtualenvwrapper.sh
(找不到此文件则用 find / -name virtualenvwrapper.sh 来搜索)

Create a virtual env

mkvirtualenv --python=`which python3` <vir_env_name>

List Virtual Environments

lsvirtualenv -b

Change Virtual Environments

workon <vir_env_name>

List site packages

lssitepackages

Exit the Virtual Environments

deactivate 

Remove Virtual Environment

rmvirtualenv <vir_env_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment