How to add virtualenv to path

It seems that I myself am the exception to the rule for almost all 'simple' installation procedures. For some reason, it WAS a path related issue:

I ran brew info python, which outputted a lot of information. At the bottom I found this:

Executable python scripts will be put in:
/usr/local/share/python
so you may want to put "/usr/local/share/python" in your PATH, too.

I added that to my PATH in /etc/launchd.conf and ~/.bashrc and lo and behold:

$ which virtualenv 

tells me:

"/usr/local/share/python/virtualenv"

I still don't know why I couldn't find any pointers in the right direction, online, anywhere? Is pip install virtualenv supposed to add to the PATH itself? If so, why not on my system? Why did @bibhas tell me explicitly it was not a path issue?


In your .bashrc you need to have:

export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

(Mac / Linux specific) So I got an error message when I did a pip3 install --user --upgrade virtualenv telling me that I did not have Users/home/Library/Python/3.7/bin in my PATH. So I simply added it.

If this is on the Mac, the following did it for me

vi ~/.bash_profile



PATH="/Users/home/Library/Python/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"

restart your terminal and type virtualenv env and that should do it.


Had the same issue after pip install virtualenv

When I inspected python ls -la /usr/local/bin/python I found it was symbolically linked to /Library/Frameworks/Python.framework/Versions/2.7/bin/python

When I cd in that directory I also found the virtualenv executable and

Fixed it by

  1. cd /Library/Frameworks/Python.framework/Versions/2.7/bin
  2. ln virtualenv /usr/local/bin/virtualenv

Sidenote: I also happen to have a python installation in /System/Library/Frameworks/Python.framework/Versions/2.7/bin

I believe that's the one that came with OSX