简体   繁体   English

在 Mac (OS X 10.11.1) 上安装 mrjob 时出错

[英]Error installing mrjob on Mac (OS X 10.11.1)

Typing in Terminal在终端输入

pip install mrjob pip安装mrjob

gives the error message: "NameError: name 'execfile' is not defined" and "Command "python setup.py egg_info" failed with error code 1 in /private..."给出错误消息:“NameError: name 'execfile' is not defined”和“命令“python setup.py egg_info”在/private 中失败,错误代码为 1...”

Using使用

sudo pip install mrjob须藤 pip 安装 mrjob

also gives the same error message.也给出了同样的错误信息。 In addition, it gives this message:此外,它还给出了以下消息:

Password: The directory '/Users/.../Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled.密码:目录“/Users/.../Library/Caches/pip/http”或其父目录不属于当前用户所有,缓存已禁用。 Please check the permissions and owner of that directory.请检查该目录的权限和所有者。 If executing pip with sudo, you may want sudo's -H flag.如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志。 The directory '/Users/.../Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled.目录“/Users/.../Library/Caches/pip”或其父目录不属于当前用户所有,并且缓存轮已被禁用。 check the permissions and owner of that directory.检查该目录的权限和所有者。 If executing pip with sudo, you may want sudo's -H flag.如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志。

How do I successfully install?我如何成功安装?

Between March 2015 and May 2015, the mrjob setup.py used the Python-2 only built-in functionexecfile , which was removed from the Python 3 built-in functions . 20153 月2015 年5月期间, mrjob setup.py仅使用 Python-2 内置函数execfile ,该函数已从Python 3 内置函数 中删除。

The NameError you encountered strongly suggests that the problem was due to using the Python 3 interpreter.您遇到的NameError强烈表明问题是由于使用 Python 3 解释器造成的。

The project had a similar bug raised in September 2015, and the fixed setup.py had not yet been released at that time.该项目在 2015 年 9 月提出了一个类似的错误,当时修复的setup.py尚未发布。 It appears that this bug was fixed in v0.5.0 , released 28 March 2016.似乎此错误已在 2016 年 3 月 28 日发布的v0.5.0中修复。

To install, use a version criteria:要安装,请使用版本标准:

pip install --user "mrjob>=5"

Also probably upgrading pip might solve the problems you mention wrt sudo , but that seems like an unrelated problem best addressed in a separate question.也可能升级 pip 可能会解决您提到的问题sudo ,但这似乎是一个不相关的问题,最好在单独的问题中解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM