2
重啓我的機器後,我可以看到當我的登錄腳本調用它時,virtualenv無法設置。Python virtualenvwrapper初始化錯誤
我的.bashrc包含
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
和錯誤看起來像
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 12, in <module>
import optparse
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 77, in <module>
import textwrap
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py", line 32, in <module>
class TextWrapper:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py", line 74, in TextWrapper
whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
AttributeError: 'module' object has no attribute 'maketrans'
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.
據我所知道的,項目提到的錯誤信息看行不行,
ytestpythonapp$ls /Library/Python/2.7/site-packages/
README pip-1.1-py2.7.egg virtualenv.py virtualenv_support virtualenvwrapper-3.2-py2.7-nspkg.pth
easy-install.pth virtualenv-1.7.1.2-py2.7.egg-info virtualenv.pyc virtualenvwrapper virtualenvwrapper-3.2-py2.7.egg-info
and
mytestpythonapp$ls /usr/local/bin/ | grep vir
virtualenv
virtualenvwrapper.sh
和
mytestpythonapp$echo $PATH
/Users/markdsievers/.virtualenvs/mytestpythonapp/bin:/usr/local/bin:/Users/markdsievers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mongodb/bin:/usr/local/cmd:/usr/local/sbin:
我是相當新的Python的,但有virualenv現在幾個星期的工作在許多重新啓動,所以我所有的這個漂亮的困惑。任何指針非常讚賞。
OSX獅子, 的Python 2.7