【问题标题】:Pydoop Installation on CentOS 6CentOS 6 上的 Pydoop 安装
【发布时间】:2017-05-07 01:10:16
【问题描述】:

我正在尝试在 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 并且升级它可能会导致问题。请问有什么建议吗?

【问题讨论】:

  • pydoop 需要 2.7 但如果不想弄乱您当前的安装,您可以使用 Pyenv 创建一个单独的隔离环境。 github.com/pyenv/pyenv

标签: python hadoop hortonworks-data-platform


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2018-12-10
    • 2013-12-06
    • 2013-06-21
    • 2013-08-08
    • 2013-06-11
    • 2014-07-10
    • 2014-06-11
    • 2016-03-06
    相关资源
    最近更新 更多