简体   繁体   中英

Error installing pydoop with pip on Ubuntu 18.04

I am trying to install pydoop with pip on my Ubuntu 18.04 and keep getting an error "Failed building wheel for pydoop".

pip install pydoop
/bin/sh: 1: hadoop: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-zqQz1I/pydoop/setup.py", line 368, in <module>
        zip_safe=False,
      File "/home/andrew/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/andrew/.local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
        self.run_command('build')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-zqQz1I/pydoop/setup.py", line 320, in run
        self.build_java()
      File "/tmp/pip-build-zqQz1I/pydoop/setup.py", line 301, in build_java
        jb = JavaBuilder(self.build_temp, self.build_lib)
      File "/tmp/pip-build-zqQz1I/pydoop/setup.py", line 199, in __init__
        self.java_libs = [JavaLib()]
      File "/tmp/pip-build-zqQz1I/pydoop/setup.py", line 183, in __init__
        self.classpath = pydoop.hadoop_classpath()
      File "pydoop/__init__.py", line 79, in hadoop_classpath
        return _PATH_FINDER.hadoop_classpath()
      File "pydoop/hadoop_utils.py", line 126, in hadoop_classpath
        "hadoop classpath --glob", shell=True, universal_newlines=True
      File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
        raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command 'hadoop classpath --glob' returned non-zero exit status 127

It seems as though it is not recognizing the hadoop command, however, whenever I use this in the command line there is no problem. I included the path to hadoop in the.bashrc file.

As suggested in the comments, sh is not going to use .bashrc . Try adding the Hadoop binaries to your PATH, eg, export PATH="${hadoop_home}/bin:${hadoop_home}/sbin:${PATH}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM