I am trying to find out why my virtualenv
and/or virtualenv
wrapper - installed using pip
using homebrew
- cannot be foun
In your .bashrc you need to have:
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
This solution will give you an alternate tool to use and solve your virtualenv
problem at the same time.
Use pythonbrew. It is inspired from rvm
in the ruby world and is helpful in managing pythons on your system and also wrap virtualenv
commands to provide virtual environment management. I use it Mountain Lion for my development purposes and have had no problems. More details (on my blog): http://stacktoheap.com/blog/2013/03/11/why-use-virtualenv-when-there-is-pythonbrew/
(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.
For those with Python 2.7, I came across this as well, and solved it by simply putting the following line into the \etc\paths
file (may need to $ sudo chmod
it first):
/Library/Frameworks/Python.framework/Versions/2.7/bin
Save the change and start a new Terminal session. Check it with echo $PATH
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
cd /Library/Frameworks/Python.framework/Versions/2.7/bin
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
The module in /usr/local/lib/python2.7/site-packages
is imported by a short script that uses pkg_resources.load_entry_point
to run the application. The utility script should be in /usr/local/bin
.