pydop

ippsafx7  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(391)

我正在安装pydoop(https://crs4.github.io/pydoop/installation.html)在centos 6上(hortonworks hdp物理集群,4个节点)。我的主机上安装了Python3.4和Python2.6。当我使用Python3安装它时,它会显示如下语法错误:

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

当我使用python2安装它时,它显示以下错误

[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,升级它可能会导致问题。有什么建议吗?

oewdyzsn

oewdyzsn1#

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

相关问题