New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install using pip #82

Open
rchurt opened this Issue May 13, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@rchurt

rchurt commented May 13, 2016

Hello,
When I try to install javabridge using pip, it fails with the following error:

pip install javabridge       
Collecting javabridge
  Using cached javabridge-1.0.14.tar.gz
Requirement already satisfied (use --upgrade to upgrade): numpy in ./anaconda/lib/python3.5/site-packages (from javabridge)
Building wheels for collected packages: javabridge
  Running setup.py bdist_wheel for javabridge ... error
  Complete output from command /Users/Rob/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/tmpcklst7alpip-wheel- --python-tag cp35:
  Failed to run /usr/libexec/java_home, defaulting to best guess for Java
  Traceback (most recent call last):
    File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
      os.path.join(os.path.dirname(path), "Libraries"),
    File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
      genericpath._check_arg_types('join', a, *p)
    File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
      raise TypeError("Can't mix strings and bytes in path components") from None
  TypeError: Can't mix strings and bytes in path components
  Failed to run /usr/libexec/java_home, defaulting to best guess for Java
  Traceback (most recent call last):
    File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
      os.path.join(os.path.dirname(path), "Libraries"),
    File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
      genericpath._check_arg_types('join', a, *p)
    File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
      raise TypeError("Can't mix strings and bytes in path components") from None
  TypeError: Can't mix strings and bytes in path components
  Failed to run /usr/libexec/java_home, defaulting to best guess for Java
  Traceback (most recent call last):
    File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
      os.path.join(os.path.dirname(path), "Libraries"),
    File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
      genericpath._check_arg_types('join', a, *p)
    File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
      raise TypeError("Can't mix strings and bytes in path components") from None
  TypeError: Can't mix strings and bytes in path components
  Failed to run /usr/libexec/java_home, defaulting to best guess for Java
  Traceback (most recent call last):
    File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
      os.path.join(os.path.dirname(path), "Libraries"),
    File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
      genericpath._check_arg_types('join', a, *p)
    File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
      raise TypeError("Can't mix strings and bytes in path components") from None
  TypeError: Can't mix strings and bytes in path components
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.5-x86_64-3.5
  creating build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/__init__.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/_version.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/jutil.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/locate.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/noseplugin.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  copying javabridge/wrappers.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
  creating build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  copying javabridge/tests/__init__.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  copying javabridge/tests/test_cpython.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  copying javabridge/tests/test_javabridge.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  copying javabridge/tests/test_jutil.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  copying javabridge/tests/test_wrappers.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
  creating build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
  copying javabridge/jars/cpython.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
  copying javabridge/jars/rhino-1.7R4.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
  copying javabridge/jars/runnablequeue.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
  copying javabridge/jars/test.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
  running build_ext
  javac -source 6 -target 6 /private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
  Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jre1.8.0_66.jre/Contents/Home/bin/javac" (-1)
  error: command 'javac' failed with exit status 2

  ----------------------------------------
  Failed building wheel for javabridge
  Running setup.py clean for javabridge
Failed to build javabridge
Installing collected packages: javabridge
  Running setup.py install for javabridge ... error
    Complete output from command /Users/Rob/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-z9l3mx7l-record/install-record.txt --single-version-externally-managed --compile:
    Failed to run /usr/libexec/java_home, defaulting to best guess for Java
    Traceback (most recent call last):
      File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
        os.path.join(os.path.dirname(path), "Libraries"),
      File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
        genericpath._check_arg_types('join', a, *p)
      File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
        raise TypeError("Can't mix strings and bytes in path components") from None
    TypeError: Can't mix strings and bytes in path components
    Failed to run /usr/libexec/java_home, defaulting to best guess for Java
    Traceback (most recent call last):
      File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
        os.path.join(os.path.dirname(path), "Libraries"),
      File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
        genericpath._check_arg_types('join', a, *p)
      File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
        raise TypeError("Can't mix strings and bytes in path components") from None
    TypeError: Can't mix strings and bytes in path components
    Failed to run /usr/libexec/java_home, defaulting to best guess for Java
    Traceback (most recent call last):
      File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
        os.path.join(os.path.dirname(path), "Libraries"),
      File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
        genericpath._check_arg_types('join', a, *p)
      File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
        raise TypeError("Can't mix strings and bytes in path components") from None
    TypeError: Can't mix strings and bytes in path components
    Failed to run /usr/libexec/java_home, defaulting to best guess for Java
    Traceback (most recent call last):
      File "/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/javabridge/locate.py", line 45, in find_javahome
        os.path.join(os.path.dirname(path), "Libraries"),
      File "/Users/Rob/anaconda/lib/python3.5/posixpath.py", line 89, in join
        genericpath._check_arg_types('join', a, *p)
      File "/Users/Rob/anaconda/lib/python3.5/genericpath.py", line 145, in _check_arg_types
        raise TypeError("Can't mix strings and bytes in path components") from None
    TypeError: Can't mix strings and bytes in path components
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.5-x86_64-3.5
    creating build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/__init__.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/_version.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/jutil.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/locate.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/noseplugin.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    copying javabridge/wrappers.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge
    creating build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    copying javabridge/tests/__init__.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    copying javabridge/tests/test_cpython.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    copying javabridge/tests/test_javabridge.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    copying javabridge/tests/test_jutil.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    copying javabridge/tests/test_wrappers.py -> build/lib.macosx-10.5-x86_64-3.5/javabridge/tests
    creating build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
    copying javabridge/jars/cpython.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
    copying javabridge/jars/rhino-1.7R4.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
    copying javabridge/jars/runnablequeue.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
    copying javabridge/jars/test.jar -> build/lib.macosx-10.5-x86_64-3.5/javabridge/jars
    running build_ext
    javac -source 6 -target 6 /private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
    Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jre1.8.0_66.jre/Contents/Home/bin/javac" (-1)
    error: command 'javac' failed with exit status 2

    ----------------------------------------
Command "/Users/Rob/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-z9l3mx7l-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/jn/pt_9j7j52wz9jq8bzlg7bf1h0000gn/T/pip-build-9lyy16or/javabridge/

Any suggestions?

Thanks,
Rob

@LeeKamentsky

This comment has been minimized.

Owner

LeeKamentsky commented May 16, 2016

It looks like Javabridge's install is finding the JRE instead of the Java SDK:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jre1.8.0_66.jre/Contents/Home/bin/javac

Do you have the SDK installed? If so and you are getting the above, you might try setting JAVA_HOME to point to the SDK's root directory before doing the pip install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment