【发布时间】:2012-03-11 21:24:19
【问题描述】:
我正在尝试使用 easy_install 安装新模块。
当我运行类似的命令时
sudo easy_install foo
foo 被安装到~/Library/Python/2.7/site-packages/。
这似乎是错误的,因为我无法从我的 python shell 中使用任何已安装的模块。
在阅读了一些与easy_install问题相关的SO帖子后,根据我的理解,正确的目录应该是/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
,因为我的 python shell 使用/usr/local/bin/python 符号链接到所述目录。
我如何告诉 easy_install 使用这个目录而不是当前目录?
谢谢,
朱利安
编辑:我使用选项 -d /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 重新运行 setuptools 安装。输出如下:
Processing setuptools-0.6c11-py2.7.egg
Removing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Installing easy_install-2.7 script to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
例如的输出sudo easy_install mechanize是
Searching for mechanize
Best match: mechanize 0.2.5
Processing mechanize-0.2.5-py2.7.egg
mechanize 0.2.5 is already the active version in easy-install.pth
Using /Users/julian/Library/Python/2.7/site-packages/mechanize-0.2.5-py2.7.egg
Processing dependencies for mechanize
Finished processing dependencies for mechanize
好像easy_install还在用错目录?!高度赞赏帮助。谢谢。
【问题讨论】:
标签: python easy-install