在 Mac (OS X 10.11.1) 上安装 mrjob 时出错
Error installing mrjob on Mac (OS X 10.11.1)
在终端中输入
pip install mrjob
给出错误信息:"NameError: name 'execfile' is not defined" and "Command "python setup.py egg_info" failed with error code 1 in /private..." =15=]
使用
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 and May 2015, the mrjob
setup.py
used the Python-2 only built-in function execfile
, which was removed from the Python 3 built-in functions.
之间
您遇到的 NameError
强烈建议问题是由于使用 Python 3 解释器造成的。
该项目有一个 similar bug raised in September 2015, and the fixed setup.py
had not yet been released at that time. It appears that this bug was fixed in v0.5.0,发布于 2016 年 3 月 28 日。
要安装,请使用版本标准:
pip install --user "mrjob>=5"
升级 pip 也可能会解决您提到的问题 sudo
,但这似乎是一个不相关的问题,最好在单独的问题中解决。
在终端中输入
pip install mrjob
给出错误信息:"NameError: name 'execfile' is not defined" and "Command "python setup.py egg_info" failed with error code 1 in /private..." =15=]
使用
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 and May 2015, the mrjob
setup.py
used the Python-2 only built-in function execfile
, which was removed from the Python 3 built-in functions.
您遇到的 NameError
强烈建议问题是由于使用 Python 3 解释器造成的。
该项目有一个 similar bug raised in September 2015, and the fixed setup.py
had not yet been released at that time. It appears that this bug was fixed in v0.5.0,发布于 2016 年 3 月 28 日。
要安装,请使用版本标准:
pip install --user "mrjob>=5"
升级 pip 也可能会解决您提到的问题 sudo
,但这似乎是一个不相关的问题,最好在单独的问题中解决。