2013-10-29 145 views
0

我想用django1.4配置virtualenvwrapper。我下面this post,我試圖做什麼它說:Virtualenvwrapper安裝雪豹python

Admin$ pip install virtualenvwrapper 
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/site-packages 
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper) 
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper) 
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper) 

Admin$ export WORKON_HOME=$HOME/.virtualenvs 
Admin$ export PROJECT_HOME=$HOME/Users/Admin 
Admin$ source /usr/local/bin/virtualenvwrapper.sh 
/usr/bin/python: No module named virtualenvwrapper 
virtualenvwrapper.sh: There was a problem running the initialization hooks. 

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

Admin$ mkvirtualenv --python=python2.7 mynewenv 
The executable /Users/Admin/python2.7 (from --python=/Users/Admin/python2.7) does not exist 

誰能幫我弄清楚如何獲得virtualenvwrapper建立在我的OSX雪豹安裝?非常感謝你的幫助!

回答

0

看起來你正在嘗試使用python2.7,但你還沒有告訴virtualenvwrapper這件事。在source /usr/local/bin/virtualenvwrapper.sh之前嘗試添加export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7(假設這是您的python2.7安裝所在的位置) - 即

Admin$ export WORKON_HOME=$HOME/.virtualenvs 
Admin$ export PROJECT_HOME=$HOME/Users/Admin 
Admin$ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 
Admin$ source /usr/local/bin/virtualenvwrapper.sh