Java – Pydoop Java home not set installation problems

Pydoop Java home not set installation problems… here is a solution to the problem.

Pydoop Java home not set installation problems

When I echo $JAVA_HOME, I get the path to Java. Hadoop is also running, but the pydoop installation fails due to this error.

Traceback (most recent call last):
  File "setup.py", line 54, in <module>
    raise RuntimeError("java home not found, try setting JAVA_HOME")
RuntimeError: java home not found, try setting JAVA_HOME

I run the setup command using sudo python setup.py install --skip-build.
You receive this error as a non-root user
Run the installation
Run the installation library
Create /usr/local/lib/python2.7/dist-packages/pydoop
Error: Unable to create ‘/usr/local/lib/python2.7/dist-packages/pydoop’: permission denied

Solution

When you run the setup with sudo, it runs under the root account, where there may not be a JAVA_HOME defined.

You can choose:

  • Export the correct JAVA_HOME for root;
  • Or use virtualenv to install pydoop in a virtual environment under the current user, without sudo;
  • Or use the settings options to specify build and installation directories without root privileges.

Related Problems and Solutions