Search code examples
python-3.xhomebrewvirtualenvwrapper

virtualenvwrapper initialization error (


I am trying to set up virtualenv using virtualenvwrapper for my Django project following this guide : Django Tutorial. However, after installing and writing,

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

and trying to run source ~/.bash_profile, i kept getting no directory error. I researched about this error and thought that the error kept coming up because I installed python3 with homebrew.

Therefore, i changed VIRTUALENVWRAPPER_PYTHON directory to /usr/local/Cellar/python/3.6.4_4 virtualenvwrapper.sh.

But now I am getting this error:

virtualenvwrapper_run_hook:12: permission denied: /usr/local/Cellar/python/3.6.4_4
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/Cellar/python/3.6.4_4 and that PATH is
set properly.

How can i reset the PATH so that I can use virtualenvwrapper?


Solution

  • You can try it, add this to your ~/.bashrc, it works for me

    export WORKON_HOME=$HOME/.virtualenvs
    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
    source /usr/local/bin/virtualenvwrapper.sh