简体   繁体   中英

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?

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

Install virtualenvwrapper using pip

sudo pip3 install virtualenvwrapper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM