为什么我通过 easy_install 安装的模块无法使用?
我最近尝试在我的 mac 上通过 easy_install
安装几个 python 模块。
背景:
我使用的是 OS X 10.6.8 和 Python 2.7.2。如果我运行 which python
,我会得到以下信息:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
问题:
如果我尝试安装一个包,比如 easy_install cssutils
- 它会找到该包,下载并说它已安装,但是当我打开 python 并输入 import cssutils
- 它说找不到该包。
多个软件包都发生过这种情况,但是如果软件包有自己的安装程序脚本并且我运行它,它们就会起作用。
如何让 easy_install
正确安装软件包?
I recently tried to install a couple of python modules via easy_install
on my mac.
Background:
I'm using OS X 10.6.8 and Python 2.7.2. If I run which python
I get the following:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
Problem:
If I try to install a package, say easy_install cssutils
- it finds the package, downloads and says it's installed, but when I then open python and type import cssutils
- it says the package isn't found.
This has happened with multiple packages, but they do however work if the package has it's own installer script and I run that.
How can I get easy_install
to install the packages correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入:
在命令行 将显示 easy_install 正在使用的解释器。如果它与您正在使用的 python 版本不匹配,您可能需要为您正在使用的 python 版本安装设置工具。或者,如果存在正确版本的 easy install,您可以使用绝对路径运行它,引用特定的 easy_install 变体(例如 easy_install-2.7),或者更新您的路径。
Typing:
at the command line will show the interpreter that easy_install is using. If it doesn't match the python version you're using, you may need to install setup tools for the version of python you're using. Alternately, if the correct version of easy install is present, you can either run it by using an absolute path, reference the specific easy_install variant (e.g. easy_install-2.7), or update your path.