gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 05:41:03 25 4
gpt4 key购买 nike

在终端中输入

pip install mrjob

给出错误信息:“NameError: name 'execfile' is not defined”和“Command 'python setup.py egg_info' failed with error code 1 in/private...”

使用

sudo pip install mrjob

也给出相同的错误信息。此外,它还提供以下消息:

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. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/.../Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

如何成功安装?

最佳答案

March 2015 之间和 May 2015 年,mrjob setup.py 使用了 Python-2 独有的内置函数 execfile ,已从 Python 3 built-in functions 中删除.

您遇到的 NameError 强烈表明问题是由于使用 Python 3 解释器造成的。

该项目有一个 similar bug 2015年9月提出,当时修复的setup.py还没有发布。看来此错误已在 v0.5.0 中修复,2016 年 3 月 28 日发布。

要安装,请使用版本标准:

pip install --user "mrjob>=5"

升级 pip 也可能会解决您提到的关于 sudo 的问题,但这似乎是一个不相关的问题,最好在单独的问题中解决。

关于python - 在 Mac (OS X 10.11.1) 上安装 mrjob 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33897917/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com