Skip to content
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

Pip installation fails for most recent release of python-javabridge on macOS Monterey (the 4.0.0 release works though) #208

Open
tomouellette opened this issue Nov 8, 2022 · 0 comments

Comments

@tomouellette
Copy link

Hi there,

I'm having similar issues installing the most recent release of python-javabridge on macOS Monterey (v12.6.1). I posted the error report below.

However, for anyone facing this issue the version 4.0.0 release of python-javabridge installs and works for me i.e. pip install python-javabridge==4.0.0. Hopefully, this helps for pinpointing the underlying issue for macOS users @LeeKamentsky

Processing /Users/touellette/Research/Pulls/python-javabridge
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /Applications/anaconda3/lib/python3.8/site-packages (from javabridge==1.0.19.post9+gc8c12b4) (1.22.0)
Building wheels for collected packages: javabridge
  Building wheel for javabridge (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]
      running bdist_wheel
      running build
      running build_py
      running build_ext
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/test/RealRect.java
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPython.java /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java
      Note: /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java uses unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      building 'javabridge._javabridge' extension
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/System/Library/Frameworks/JavaVM.Framework/Headers -I/Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include -I/Applications/anaconda3/include/python3.8 -c _javabridge.c -o build/temp.macosx-10.9-x86_64-cpython-38/_javabridge.o
      In file included from _javabridge.c:746:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960:
      /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
      #warning "Using deprecated NumPy API, disable it with " \
       ^
      In file included from _javabridge.c:754:
      ./mac_javabridge_utils.h:35:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
      ^
      ./mac_javabridge_utils.h:35:26: error: unknown type name 'JavaVM'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
                               ^
      ./mac_javabridge_utils.h:35:40: error: unknown type name 'JavaVMInitArgs'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
                                             ^
      ./mac_javabridge_utils.h:46:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacStopVM();
      ^
      ./mac_javabridge_utils.h:46:25: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacStopVM();
                              ^
                               void
      ./mac_javabridge_utils.h:54:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopInit();
      ^
      ./mac_javabridge_utils.h:54:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopInit();
                                   ^
                                    void
      ./mac_javabridge_utils.h:62:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopRun();
      ^
      ./mac_javabridge_utils.h:62:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopRun();
                                  ^
                                   void
      ./mac_javabridge_utils.h:70:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopReset();
      ^
      ./mac_javabridge_utils.h:70:31: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopReset();
                                    ^
                                     void
      ./mac_javabridge_utils.h:78:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacStopRunLoop();
      ^
      ./mac_javabridge_utils.h:78:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacStopRunLoop();
                                   ^
                                    void
      ./mac_javabridge_utils.h:87:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT int MacIsMainThread();
      ^
      ./mac_javabridge_utils.h:87:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT int MacIsMainThread();
                                   ^
                                    void
      ./mac_javabridge_utils.h:102:20: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      void MacRunLoopStop();
                         ^
                          void
      ./mac_javabridge_utils.h:104:13: error: unknown type name 'JavaVM'
      void StopVM(JavaVM *vm);
                  ^
      ./mac_javabridge_utils.h:106:18: error: unknown type name 'JavaVM'
      int CreateJavaVM(JavaVM **pvm, void **pEnv, void *args);
                       ^
      _javabridge.c:1311:3: error: unknown type name 'jobject'
        jobject o;
        ^
      _javabridge.c:1325:3: error: unknown type name 'jclass'
        jclass c;
        ^
      _javabridge.c:1338:3: error: unknown type name 'jmethodID'
        jmethodID id;
        ^
      _javabridge.c:1353:3: error: unknown type name 'jfieldID'
        jfieldID id;
        ^
      _javabridge.c:1368:3: error: unknown type name 'JavaVM'
        JavaVM *vm;
        ^
      _javabridge.c:1381:3: error: unknown type name 'JNIEnv'
        JNIEnv *env;
        ^
      _javabridge.c:2127:22: error: unknown type name 'jbyte'
      static CYTHON_INLINE jbyte __Pyx_PyInt_As_jbyte(PyObject *);
                           ^
      _javabridge.c:2130:22: error: unknown type name 'jshort'
      static CYTHON_INLINE jshort __Pyx_PyInt_As_jshort(PyObject *);
                           ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      8 warnings and 20 errors generated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: 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
  error: subprocess-exited-with-error
  
  × Running setup.py install for javabridge did not run successfully.
  │ exit code: 1
  ╰─> [130 lines of output]
      running install
      /Applications/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-cpython-38
      creating build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/_version.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/jutil.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/locate.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/wrappers.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      copying javabridge/noseplugin.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge
      creating build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      copying javabridge/tests/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      copying javabridge/tests/test_cpython.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      copying javabridge/tests/test_javabridge.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      copying javabridge/tests/test_jutil.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      copying javabridge/tests/test_wrappers.py -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/tests
      creating build/lib.macosx-10.9-x86_64-cpython-38/javabridge/jars
      copying javabridge/jars/rhino-1.7R4.jar -> build/lib.macosx-10.9-x86_64-cpython-38/javabridge/jars
      running build_ext
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
      jar cf /Users/touellette/Research/Pulls/python-javabridge/build/lib.macosx-10.9-x86_64-cpython-38/javabridge/jars/runnablequeue.jar -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/runnablequeue/RunnableQueue.class -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/runnablequeue/RunnableQueue$1.class
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/test/RealRect.java
      jar cf /Users/touellette/Research/Pulls/python-javabridge/build/lib.macosx-10.9-x86_64-cpython-38/javabridge/jars/test.jar -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/test/RealRect.class
      javac /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPython.java /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java
      Note: /Users/touellette/Research/Pulls/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java uses unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      jar cf /Users/touellette/Research/Pulls/python-javabridge/build/lib.macosx-10.9-x86_64-cpython-38/javabridge/jars/cpython.jar -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/CPythonInvocationHandler.class -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/CPython.class -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/CPython$WrappedException.class -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/CPython$StackFrame.class -C /Users/touellette/Research/Pulls/python-javabridge/java org/cellprofiler/javabridge/CPythonInvocationHandler.class
      building 'javabridge._javabridge' extension
      creating build/temp.macosx-10.9-x86_64-cpython-38
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/System/Library/Frameworks/JavaVM.Framework/Headers -I/Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include -I/Applications/anaconda3/include/python3.8 -c _javabridge.c -o build/temp.macosx-10.9-x86_64-cpython-38/_javabridge.o
      In file included from _javabridge.c:746:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
      In file included from /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960:
      /Applications/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
      #warning "Using deprecated NumPy API, disable it with " \
       ^
      In file included from _javabridge.c:754:
      ./mac_javabridge_utils.h:35:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
      ^
      ./mac_javabridge_utils.h:35:26: error: unknown type name 'JavaVM'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
                               ^
      ./mac_javabridge_utils.h:35:40: error: unknown type name 'JavaVMInitArgs'
      JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
                                             ^
      ./mac_javabridge_utils.h:46:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacStopVM();
      ^
      ./mac_javabridge_utils.h:46:25: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacStopVM();
                              ^
                               void
      ./mac_javabridge_utils.h:54:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopInit();
      ^
      ./mac_javabridge_utils.h:54:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopInit();
                                   ^
                                    void
      ./mac_javabridge_utils.h:62:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopRun();
      ^
      ./mac_javabridge_utils.h:62:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopRun();
                                  ^
                                   void
      ./mac_javabridge_utils.h:70:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacRunLoopReset();
      ^
      ./mac_javabridge_utils.h:70:31: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacRunLoopReset();
                                    ^
                                     void
      ./mac_javabridge_utils.h:78:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT void MacStopRunLoop();
      ^
      ./mac_javabridge_utils.h:78:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT void MacStopRunLoop();
                                   ^
                                    void
      ./mac_javabridge_utils.h:87:1: error: unknown type name 'JNIEXPORT'
      JNIEXPORT int MacIsMainThread();
      ^
      ./mac_javabridge_utils.h:87:30: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      JNIEXPORT int MacIsMainThread();
                                   ^
                                    void
      ./mac_javabridge_utils.h:102:20: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      void MacRunLoopStop();
                         ^
                          void
      ./mac_javabridge_utils.h:104:13: error: unknown type name 'JavaVM'
      void StopVM(JavaVM *vm);
                  ^
      ./mac_javabridge_utils.h:106:18: error: unknown type name 'JavaVM'
      int CreateJavaVM(JavaVM **pvm, void **pEnv, void *args);
                       ^
      _javabridge.c:1311:3: error: unknown type name 'jobject'
        jobject o;
        ^
      _javabridge.c:1325:3: error: unknown type name 'jclass'
        jclass c;
        ^
      _javabridge.c:1338:3: error: unknown type name 'jmethodID'
        jmethodID id;
        ^
      _javabridge.c:1353:3: error: unknown type name 'jfieldID'
        jfieldID id;
        ^
      _javabridge.c:1368:3: error: unknown type name 'JavaVM'
        JavaVM *vm;
        ^
      _javabridge.c:1381:3: error: unknown type name 'JNIEnv'
        JNIEnv *env;
        ^
      _javabridge.c:2127:22: error: unknown type name 'jbyte'
      static CYTHON_INLINE jbyte __Pyx_PyInt_As_jbyte(PyObject *);
                           ^
      _javabridge.c:2130:22: error: unknown type name 'jshort'
      static CYTHON_INLINE jshort __Pyx_PyInt_As_jshort(PyObject *);
                           ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      8 warnings and 20 errors generated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> javabridge

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant