2011-11-22 74 views
1

我一直在Python中使用Heroku的雪松堆棧一段時間,沒有任何錯誤。然而今天,當我決定在我的經sudo bin/pip install -r requirementsvirtualenv我收到以下錯誤更新我的依賴本地,:在Virtualenv中使用Python的Pip

Traceback (most recent call last): 
    File "/Users/alex/Desktop/dev/warren/warren/bin/pip", line 5, in <module> 
    from pkg_resources import load_entry_point 
    File "/Users/alex/Desktop/dev/warren/warren/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 698, in <module> 
    File "/Users/alex/Desktop/dev/warren/warren/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 701, in Environment 
    File "/Users/alex/Desktop/dev/warren/warren/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 96, in get_supported_platform 
    File "/Users/alex/Desktop/dev/warren/warren/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 221, in get_build_platform 
    File "/Users/alex/Desktop/dev/warren/warren/lib/python2.6/distutils/__init__.py", line 16, in <module> 
    exec(open(os.path.join(distutils_path, '__init__.py')).read()) 
IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/__init__.py' 

我懷疑這有某事與我升級到獅子(如指出, this question),但正如在那個問題中提到的,我也更新了Xcode,但問題仍然存在。

當我嘗試cd到上面的目錄沒有__init__.py文件,其實還有所有,只是.pyo.pyc文件沒有.py文件。

+0

什麼是用於運行virtualenv中的命令行? – Mark

+0

嘗試不使用「sudo」。你不需要virtualenv中的root權限。 –

+1

@Mark'source bin/activate'。 –

回答

4

您收到的錯誤消息是由於virtualenv爲您的系統python創建的鏈接。您現在想要銷燬virtualenv並重新創建它。要消滅它,你會想:

rm -r bin 
rm -r include 
rm -r lib 
rm .Python 

那麼你應該能夠重新創建你的virtualenv然後點子安裝你requirements.txt

相關問題