gpt4 book ai didi

python - 在CentOS 6上安装Pydoop

转载 作者:行者123 更新时间:2023-12-02 20:58:31 25 4
gpt4 key购买 nike

我正在尝试在CentOS 6(Hortonworks HDP物理群集,4个节点)上安装Pydoop(https://crs4.github.io/pydoop/installation.html)。我的主服务器上安装了Python 3.4和Python 2.6。当我使用Python 3安装它时,它显示语法错误,如下所示:

[root@abc]# python3 setup.py build
File "setup.py", line 45
print 'using setuptools version', setuptools.__version__
^
SyntaxError: Missing parentheses in call to 'print'

当我使用Python 2安装它时,显示以下错误
[root@abc]# python setup.py build
using setuptools version 35.0.2
Traceback (most recent call last):
File "setup.py", line 65, in <module>
import pydoop
File "/root/pydoop/pydoop/__init__.py", line 42, in <module>
_HADOOP_INFO = _PATH_FINDER.find() # fill the cache ASAP
File "/root/pydoop/pydoop/hadoop_utils.py", line 624, in find
info[a] = getattr(self, a)()
File "/root/pydoop/pydoop/hadoop_utils.py", line 433, in hadoop_home
_hadoop_home_from_version_cmd() or
File "/root/pydoop/pydoop/hadoop_utils.py", line 394, in
_hadoop_home_from_version_cmd
output = sp.check_output([hadoop_exec, 'version'])
AttributeError: 'module' object has no attribute 'check_output'

我不想将默认的python从2.6升级到2.7,因为它可能会破坏使用python2.6的yum,并且升级它可能会导致问题。有什么建议吗?

最佳答案

您可以在CentOS 6 上安装Python 2.7和pip,而不会破坏yum:

# yum update
# yum install centos-release-SCL epel-release
# yum install python27 python27-devel
# echo ". /opt/rh/python27/enable" >/etc/profile.d/python.sh
# source /etc/profile
# curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
# python get-pip.py
# python --version
Python 2.7.13
# pip --version
pip 9.0.1 from /opt/rh/python27/root/usr/lib/python2.7/site-packages (python 2.7)

关于python - 在CentOS 6上安装Pydoop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43826881/

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