pip - python的virtualenvwrapper问题
天蓬老师
天蓬老师 2017-04-17 11:14:17
0
1
642

1 在Mac上安装python2.7.3
2 安装pip
3 安装virtualenv

pip install virtualenv

4 安装virtualenvwrapper

pip install virtualenvwrapper

5 vim ~/.bash_profile

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

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

6 source配置

source ~/.bash_profile

问题来了!
创建新的虚拟环境

mkvirtualenv env1

和运行workon时

workon env1

都提示下面信息

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named virtualenvwrapper.hook_loader

Google了一些貌似python或pip的path问题,~/.bash_profile里的配置还不够吗?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

Antworte allen(1)
巴扎黑

export VIRTUALENVWRAPPER_PYTHON=python2.7

改成export VIRTUALENVWRAPPER_PYTHON=`which python`试试

另外试试重装virtualenvwrapper

sudo pip install --upgrade virtualenvwrapper
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!