CentOS 6上的Pydoop安装

时间:2017-05-07 01:10:17

标签: python hadoop hortonworks-data-platform

我正在尝试在CentOS 6上安装Pydoop(https://crs4.github.io/pydoop/installation.html)(Hortonworks HDP物理集群,4个节点)。我的主人安装了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并且升级它可能会导致问题。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

您可以在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)