2017-05-07 176 views
0

我试图在CentOS 6(Hortonworks HDP物理集群,4个节点)上安装Pydoop(https://crs4.github.io/pydoop/installation.html)。我的主站上安装了Python 3.4和Python 2.6。当我把它使用Python 3安装它显示了语法错误象下面这样:CentOS 6上的Pydoop安装

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

当我把它使用Python 2它显示了以下错误

[[email protected]]# 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' 

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

+0

pydoop要求2.7,但如果不想惹你当前的安装目录,则可以使用Pyenv创建分离孤立的环境。 https://github.com/pyenv/pyenv – Raphael

回答

0

您可以安装Python 2.7和CentOS 6的点子没有破百胜:

# 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)