I\'m trying to create a virtualenv with virtualenvwrapper
, but when I use mkvirtualenv
I get the following :
ERROR: virtualenvwrapper c
I had this same issues and tried many many things, what found as a solution is i had three pip version, pip with 2.7, 3.6 and 3.7. and 3.6 was the one works fine for many things, and install as sudo pip3.6 install virtualenv
, and it works fine.
I would suggest, check your pip version and tried to install based on your pip ver.
I have set the variable VIRTUALENVWRAPPER_VIRTUALENV
in my .zshrc to the full path of the virtualenv
binary and it works for me.
Here is my .zshrc file:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_VIRTUALENV=$HOME/Library/Python/2.7/bin/virtualenv
source $HOME/Library/Python/2.7/bin/virtualenvwrapper.sh
For me it was:
export PYTHONPATH=/usr/bin/python3
export PATH=$HOME/.local/bin:$PATH
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source ~/.local/bin/virtualenvwrapper.sh
I changed the line to:
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv
It worked.
sudo find / -name "virtualenv"
Then I find the executable file path is:
/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
Touch a soft link in the /usr/local/bin/
directory or add the path to .bash_profile
, I prefer the former:
sudo ln -s /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv /usr/local/bin/virtualenv
virtualenvwrapper
located. in my case ~/.local/bin
May be it's installed in
/usr/local/bin/
It totally depends on the System or Package Manager you are using.
.bashrc
or .zshrc
or whatever by simplyPATH=$PATH:<directory_you_want_to_add>
for example
PATH=$PATH:~/.local/bin
Also add the following configuration in .bashrc
or .zshrc
# the path you want your virtual environments to be saved and loaded from
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/<project_folder>
# most important, this is the program which loads virtualenv
# please update the path where virtualenvwrapper.sh is located
source /usr/local/bin/virtualenvwrapper.sh
Don't Forget to restart the shell.. or reload the configuration...
To test whether it worked
mkvirtualenv test
if you see a test environment created then everything is ok.
For Detailed Installation Instructions go to the docs: virtualenvwrapper installation
The way I did it was (using zsh) in this way:
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/username/Library/Python/2.7/bin:$PATH
I simply located the file of virtualenvwrapper.sh inside this path /Users/username/Library/Python/2.7/bin:$PATH
and added that path to PATH.