为什么我通过 easy_install 安装的模块无法使用?

发布于 2025-01-08 12:16:59 字数 531 浏览 4 评论 0原文

我最近尝试在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾听心声的旋律 2025-01-15 12:16:59

输入:

  head -1 `which easy_install`

在命令行 将显示 easy_install 正在使用的解释器。如果它与您正在使用的 python 版本不匹配,您可能需要为您正在使用的 python 版本安装设置工具。或者,如果存在正确版本的 easy install,您可以使用绝对路径运行它,引用特定的 easy_install 变体(例如 easy_install-2.7),或者更新您的路径。

Typing:

  head -1 `which easy_install`

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文