sudo apt install python-pip
sudo apt install python3-pip
pip --version
pip3 --version
pip install virtualenv
pip install virtualenvwrapper
# Add .local/bin to the path
export PATH=~/.local/bin:$PATH
mkdir ~/.venvs
Add virtualenv
to the plugin list:
plugins=(
git virtualenv
)
And add the following at the end of the file:
# Virtual env
export WORKON_HOME=~/.venvs
source ~/.local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=~/.venvs
Comment out export VIRTUAL_ENV_DISABLE_PROMPT=1
.
nano ~/.oh-my-zsh/plugins/virtualenv/virtualenv.plugin.zsh
source ~/.zshenv
source ~/.zshrc
cd /mnt/c/code/<your-project-folder>
mkvirtualenv testenv
workon
deactivate
You can add the following useful aliases to ~/.aliases
.
Taken from here: https://gist.github.com/bbengfort/246bc820e76b48f71df7
alias venv="workon"
alias venv.exit="deactivate"
alias venv.ls="lsvirtualenv"
alias venv.show="showvirtualenv"
alias venv.init="mkvirtualenv"
alias venv.rm="rmvirtualenv"
alias venv.switch="workon"
alias venv.add="add2virtualenv"
alias venv.cd="cdproject"
alias venv.cdsp="cdsitepackages"
alias venv.cdenv="cdvirtualenv"
alias venv.lssp="lssitepackages"
alias venv.proj="mkproject"
alias venv.setproj="setvirtualenvproject"
alias venv.wipe="wipeenv"
How about simply installing
virtualenv
similar to this: How to install python virtualenv in wsl?