0

I already installed pip and virtualenv on my mac, however I ran into issues when trying to install virtualenvwrapper. When I try to reinstall it, it says:

The directory '/Users/mhcadmin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/mhcadmin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)

But when I run mkvirtualenv I get the following message

mhcadmin$ mkvirtualenv 

-bash: mkvirtualenv: command not found

I also tried following this post Installing virtualenv virtualenvwrapper with pip on osx 10.11.1 but it didn't work.

This is what my bash_profile looks like:

# Python's virtualenvwrapper-RELATED

export WORKON_HOME=/Users/mhcadmin/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh

and this is what my bashrc looks like:

export WORKON_HOME=~/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh
Community
  • 1
  • 1
  • The link you provided is very informative. It even included Apple's stand on python developers. Having said this, don't try installing virtualenv on Apple shipped python. I use miniconda, a better alternative for virtualenv, for this purpose. – alvits Jul 08 '16 at 20:49
  • Did you take the error message's advice and use `sudo -H`? – MattDMo Jul 08 '16 at 20:51
  • 1
    @alvits OP isn't installing on the Apple-shipped Python, they're using the python.org version. – MattDMo Jul 08 '16 at 20:52
  • @MattDMo, I did try using sudo -H, but it didn't fix it – user6566852 Jul 10 '16 at 02:14

1 Answers1

2

Figured it out. Here

http://forums.macrumors.com/threads/how-do-you-find-folders-like-usr-local-bin-in-finder.99576/

I found that I could access usr/local/bin by typing

open -a Finder /usr/local/bin

Then I found the virtualenvwrapper.sh by using

which virtualenvwrapper.sh

then i just copied the virtualenvwrapper.sh into usr/local/bin