Activate virtualenv in Fish shell

Problem

If you used to be a bash shell user and then decided to move to fish, you will probably face a problem with activating your python virtual environment.

The typical method to activate a virtualenv is:

$ source your_env_name/bin/activate

This fails in Fish shell:

source: Error while reading file “your_env_name/bin/activate”

 

Solutions

The solution for this problem was much a lot easier than googling it. Thankfully, virtualenv ships with an activation script for specifically for Fish. Use that instead:

$ source your_env_name/bin/activate.fish

 

Copyright © Asia Pacific University. All Rights Reserved.