Skip to content

Instantly share code, notes, and snippets.

@shdennlin
Last active August 7, 2023 07:34
Show Gist options
  • Save shdennlin/e074067f338b89e2b7042930f2f9e950 to your computer and use it in GitHub Desktop.
Save shdennlin/e074067f338b89e2b7042930f2f9e950 to your computer and use it in GitHub Desktop.
asdf-python with virtualenv and virtualenvwrapper

If you using python version manager with asdf-vm/asdf, and you want to use virtualenv and virtualenvwrapper to be your virtual environment, you can install by following.

Install python with asdf-python

  1. Install system dependencies

  2. install python with asdf

    asdf plugin-add python
    asdf install python latest

Install virtualenvwrapper

  1. After install asdf-python, Install virtualenvwrapper with:
    pip install --user virtualenvwrapper
  2. add following to your .bashrc, .zshrc, .profile or .zprofile
    export PATH="$HOME/.local/bin:$PATH"
    
    # python virtualenv
    export WORKON_HOME=$HOME/.virtualenvs
    source $HOME/.local/bin/virtualenvwrapper_lazy.sh
  3. restart your terminal, you can use command from virtualenvwrapper, like: mkvirtualenv, lsvirtualenv, showvirtualenv, rmvirtualenv, cpvirtualenv, allvirtualenv, workon, deactivate, etc.
    Command Reference — virtualenvwrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment