python 2.7.6 pydoop失败

x6492ojm  于 2021-05-30  发布在  Hadoop
关注(0)|答案(3)|浏览(465)

我在安装pydoop包时遇到此错误:

root@ubuntu:~# pip install pydoop
Downloading/unpacking pydoop
  Downloading pydoop-1.0.0.tar.gz (931kB): 931kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pydoop/setup.py) egg_info for package pydoop
    using setuptools version 15.0
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/pydoop/setup.py", line 59, in <module>
        import pydoop.hdfs.core.impl as hdfsimpl
      File "pydoop/hdfs/__init__.py", line 99, in <module>
        init()
      File "pydoop/hdfs/__init__.py", line 93, in init
        pydoop.hadoop_classpath(), _ORIG_CLASSPATH, pydoop.hadoop_conf()
      File "pydoop/__init__.py", line 106, in hadoop_classpath
        return _PATH_FINDER.hadoop_classpath(hadoop_home)
      File "pydoop/hadoop_utils.py", line 540, in hadoop_classpath
        hadoop_home = self.hadoop_home()
      File "pydoop/hadoop_utils.py", line 399, in hadoop_home
        PathFinder.__error("hadoop home", "HADOOP_HOME")
      File "pydoop/hadoop_utils.py", line 385, in __error
        raise ValueError("%s not found, try setting %s" % (what, env_var))
    ValueError: hadoop home not found, try setting HADOOP_HOME
    Complete output from command python setup.py egg_info:
    using setuptools version 15.0

回溯(最近一次呼叫):

File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/pydoop/setup.py", line 59, in <module>

    import pydoop.hdfs.core.impl as hdfsimpl

  File "pydoop/hdfs/__init__.py", line 99, in <module>

    init()

  File "pydoop/hdfs/__init__.py", line 93, in init

    pydoop.hadoop_classpath(), _ORIG_CLASSPATH, pydoop.hadoop_conf()

  File "pydoop/__init__.py", line 106, in hadoop_classpath

    return _PATH_FINDER.hadoop_classpath(hadoop_home)

  File "pydoop/hadoop_utils.py", line 540, in hadoop_classpath

    hadoop_home = self.hadoop_home()

  File "pydoop/hadoop_utils.py", line 399, in hadoop_home

    PathFinder.__error("hadoop home", "HADOOP_HOME")

  File "pydoop/hadoop_utils.py", line 385, in __error

    raise ValueError("%s not found, try setting %s" % (what, env_var))

ValueError: hadoop home not found, try setting HADOOP_HOME

正在清理。。。命令python setup.py egg\u info失败,/tmp/pip\u build\u root/pydoop中的错误代码为1,在/home/abhimanyu/.pip/pip.log中存储失败的调试日志

vatpfxk5

vatpfxk51#

试试这个:

sudo sh -c "ls ; export HADOOP_HOME=/yourpathtohadoopinstallation/; export JAVA_HOME=/yourpathtojavainstallation/; pip install pydoop"

这对我来说是个窍门

ilmyapht

ilmyapht2#

因为我不能对saseaturtle发布的答案发表评论。我把它放在这儿了。
我一开始遇到了完全相同的问题,pydoop抱怨找不到hadoop\u home和hadoop\u prefix,而这两个字段正好在那里,下面的命令可以正确显示它们的值。

echo $HADOOP_HOME; echpHADOOP_PREFIX

我尝试了saseaturtle发布的解决方案,但是pydoop这次抱怨缺少javac,尽管shell中的javac类型可以显示正确的反馈,并且所有那些$java\u home或$java\u lib环境都设置正确。
最后,我使用以下命令成功安装了pydoop:

sudo sh -c "export PATH=/usr/java/jdk1.8.0_92/bin:$PATH; export HADOOP_HOME=/usr/local/hadoop-2.6.3; export JAVA_HOME=/home/why/download/jdk1.8.0_92; pip install pydoop"

我猜以上所有的问题都来自于环境设置,因为命令是以sudo的形式运行的。根用户可能没有将这些所需的环境变量设置为当前用户,这就是为什么添加一些导出命令可以解决问题。

ubby3x7f

ubby3x7f3#

更新/etc/profile并设置hadoop\u home和java\u home。更新/etc/profile后,注销并重新登录。
现在运行sudo-epip安装pydoop
e保护环境
看到了吗https://github.com/crs4/pydoop/issues/170 了解更多信息

相关问题