[英]Issue with Python Path. “ImportError: No module named setuptools”
我最近更新到Python 2.7,以便開始使用Django。 “ Django需要Python,尤其是Python 2.6.5-2.7.x。”
結果,當我進行出色的LPTHW練習46時,我需要安裝一些我一直在使用的工具。
應該很容易,我之前已經做完了...
當我在終端中運行python時,我得到了以下內容。 注意:Python 2.7.5
$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
當我輸入“哪個python”時,我得到
$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
但是,當我嘗試安裝Distribution,nose或virtualenv時,出現以下錯誤。 注意Python / 2.6
$ sudo pip install distribute
Exception:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.3.1-py2.6.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.3.1-py2.6.egg/pip/commands/install.py", line 258, in run
import setuptools
ImportError: No module named setuptools
Storing complete log in /Users/brendanspillane/Library/Logs/pip.log
localhost:~ brendanspillane$
我相信Python / 2.6是這里的問題。 結果,我嘗試設置我的Python路徑(我第一次)使用此問題作為參考“在Mac上更改python路徑?” 我輸入了
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
這沒有明顯的效果。
但是我仍然不能運行sudo pip install distribute
並保持收到相同的錯誤。
誰能幫我? 是我的Python路徑嗎? 還是我看錯了方向?
任何幫助一如既往,非常感謝。
困境
我不太確定它是如何工作的,但是確實可以。 @Robert Lujo值得在https://stackoverflow.com/a/16511140/1214163上獲得答案
如果在這里也添加了答案,我將接受。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.