1

I'm trying to set up Django. I have Python 3.6 installed, and I installed virtualenvwrapper using pip3.

Here is what my bash profile looks like:

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv"

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
export PROJECT_HOME=$HOME/Devel
source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh

Every time I run

$ mkvirtualenv my_django_env

I get

ERROR: virtualenvwrapper could not find virtualenv in your path
5
  • did u restart bash
    – Kevin L.
    Commented Feb 5, 2018 at 19:45
  • 1
    Possible duplicate of ERROR: virtualenvwrapper could not find virtualenv in your path
    – jsanchezs
    Commented Feb 5, 2018 at 19:53
  • @KevinL. Yes, I did Commented Feb 5, 2018 at 19:55
  • Did you install virtualenv?
    – MegaIng
    Commented Feb 5, 2018 at 19:58
  • I doubt very much that "/Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv" should be on your PATH. That env var should contain directories to search, not binaries themselves; you should have the .../3.6/bin directory there, which will then be searched for the virtualenv file. (Assuming it is actually in that directory.) Commented Feb 5, 2018 at 20:14

1 Answer 1

0

Note: This answer should have been posted here as it is more relevant to this question.

I cannot tell you how stable solution this is going to be for others. What worked for me is adding Lazy Loading which is described as an alternative initialization script. The error I was getting is that

mkvirtualenv is not in your PATH

when I tried to fire up a virtual env. Adding below script to my .zshrc file helped.

VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh source /usr/local/bin/virtualenvwrapper_lazy.sh

Please also check this out for the whole process of installing and creating virtualenv and virtualenvwrapper pacakages.

Not the answer you're looking for? Browse other questions tagged or ask your own question.