salesforce / PyRCA

PyRCA: A Python Machine Learning Library for Root Cause Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

package javabridge is not installing during pip install sfr-pyrca (using python 3.11)

vishvas-chauhan opened this issue · comments

OSError: [Errno 66] Directory not empty: '/private/var/folders/n3/mp3zkg9x3gggwvp4gwd22fvm0000gn/T/pip-install-mcnkixw6/javabridge_8d06cee0074141fdb32939b0f2fed736/.eggs/Cython-3.0.2-py3.11-macosx-10.9-universal2.egg/Cython-3.0.2.dist-info' -> '/private/var/folders/n3/mp3zkg9x3gggwvp4gwd22fvm0000gn/T/pip-install-mcnkixw6/javabridge_8d06cee0074141fdb32939b0f2fed736/.eggs/Cython-3.0.2-py3.11-macosx-10.9-universal2.egg/EGG-INFO'
[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

i have skipped javabridge from the setup.py file for now.

Hi @vishvas-chauhan, I just merged a PR which replace javabridage with a more reliable jpype dependency. If you want to use FGES, you can try to install it from source.

I am getting a similar error, why the Java requirement is necessary?

 × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-dq41ppkv/javabridge_2dde3004d3a744e19ddda45f6592f386/setup.py", line 406, in <module>
          ext_modules=ext_modules(),
        File "/tmp/pip-install-dq41ppkv/javabridge_2dde3004d3a744e19ddda45f6592f386/setup.py", line 96, in ext_modules
          java_home = find_javahome()
        File "/tmp/pip-install-dq41ppkv/javabridge_2dde3004d3a744e19ddda45f6592f386/javabridge/locate.py", line 120, in find_javahome
          java_bin = get_out(["bash", "-c", "type -p java"])
        File "/tmp/pip-install-dq41ppkv/javabridge_2dde3004d3a744e19ddda45f6592f386/javabridge/locate.py", line 117, in get_out
          raise Exception("Error finding javahome on linux: %s" % cmd)
      Exception: Error finding javahome on linux: ['bash', '-c', 'type -p java']
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

What about switching to causal learn?
It is fully python and doesn't require a Java dependency.

Hi @priamai, you can try the latest version which has replaced the dependency of javabridge to JPype. causal-learn does not provide the FGES method, which is much faster than others. If you do not want to run FGES method, then you dont need to install this dependency