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里的配置还不够吗?
Change to
export VIRTUALENVWRAPPER_PYTHON=`which python`
TryAlso try reinstalling virtualenvwrapper