oracle / graalpython

GraalPy – A high-performance embeddable Python 3 runtime for Java
https://www.graalvm.org/python/
Other
1.24k stars 108 forks source link

No such file or directory #413

Closed icode closed 2 months ago

icode commented 3 months ago

graalpy 24.0.2 graalpy maven plugin 24.0.0

Traceback (most recent call last):
  File "/tmp/vfsx5821747338116021690/proj/ai.py", line 2, in <module>
    import torch
  File "/tmp/vfsx5821747338116021690/venv/lib/python3.10/site-packages/torch/__init__.py", line 217, in <module>
    _load_global_deps()
  File "/tmp/vfsx5821747338116021690/venv/lib/python3.10/site-packages/torch/__init__.py", line 177, in _load_global_deps
    raise err
  File "/tmp/vfsx5821747338116021690/venv/lib/python3.10/site-packages/torch/__init__.py", line 172, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/tmp/vfsx5821747338116021690/home/lib-python/3/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /graalpy_vfs/venv/lib/python3.10/site-packages/torch/lib/libtorch_global_deps.so: cannot open shared object file: No such file or directory
tomasstupka commented 3 months ago

should be fixed in 24.1.0 once released, try to run with java property graalpy.vfs.extractOnStartup=true

icode commented 3 months ago

should be fixed in 24.1.0 once released, try to run with java property graalpy.vfs.extractOnStartup=true

Not working!

Traceback (most recent call last):
  File "/graalpy_vfs/proj/ai.py", line 2, in <module>
    import torch
  File "/graalpy_vfs/venv/lib/python3.10/site-packages/torch/__init__.py", line 217, in <module>
    _load_global_deps()
  File "/graalpy_vfs/venv/lib/python3.10/site-packages/torch/__init__.py", line 177, in _load_global_deps
    raise err
  File "/graalpy_vfs/venv/lib/python3.10/site-packages/torch/__init__.py", line 172, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/graalpy_vfs/home/lib-python/3/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /graalpy_vfs/venv/lib/python3.10/site-packages/torch/lib/libtorch_global_deps.so: cannot open shared object file: No such file or directory

When not have java property graalpy.vfs.extractOnStartup=true, just not have /tmp/vfsx5821747338116021690/venv/lib/python3.10/site-packages/torch/lib dir. But now, i cant not found /graalpy_vfs

tomasstupka commented 3 months ago

the property was introduced with 24.1.0, which wasn't released yet it has no effect with graalpy maven plugin 24.0.0

msimacek commented 2 months ago

You can work around it on the current version by not using the maven plugin, but instead creating and populating the virtualenv externally with a graalpy standalone and then setting the python.Executable contenxt option to the path to the bin/python executable in the virtualenv. I'm going to close the issue, since it's fixed in master.