This is a custom shell script I wrote in order to ease my workflow when dealing with Python Virtual Environments.
Download the activatevenv.plugin.sh into your computer.
- Download the script into $ZSH_CUSTOM/plugins/<plugin_name>/activatevenv/. See oh-my-zsh Plugin Customization Wiki
  # Use curl or download manually from https://git.io/JLBHr
  (mkdir activatevenv; cd activatevenv) && curl -L --url https://git.io/JLBHr --output ./activatevenv/activatevenv.plugin.zsh- Edit your ~/.zshrc:
  …
  # Add activatevenv to your list of plugins and restart the terminal.
  plugins=(... , activatevenv)
  …- Simply copy and paste the script to the bottom of your ~/.bashrcor~/.zshrcand restart your terminal.
For existing projects, simply cd into your any directory that contains either a venv/, .venv/ virtualenv created and the script will activate it automatically (Just as you would do with source ./venv/bin/activate)
If you are creating a new virtualenv run python -m <venv|virtualenv> <venv|.venv> in your root directory and to activate it manually use call activatevenv (or if you cd back into your project it will automatically activate it without the need of calling activatevenv).