cmbruns / pyopenxr

Unofficial python bindings for OpenXR access to VR and AR devices
Apache License 2.0
103 stars 8 forks source link

Fail to import pyopenxr in Ubuntu 20.04 #96

Open cambel opened 1 year ago

cambel commented 1 year ago

Hi,

I get the following error when importing this library python3 -c "import xr"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/osx/.local/lib/python3.8/site-packages/xr/__init__.py", line 6, in <module>
    from . import (
  File "/home/osx/.local/lib/python3.8/site-packages/xr/functions.py", line 11, in <module>
    from . import raw_functions
  File "/home/osx/.local/lib/python3.8/site-packages/xr/raw_functions.py", line 12, in <module>
    from .library import openxr_loader_library
  File "/home/osx/.local/lib/python3.8/site-packages/xr/library/__init__.py", line 13, in <module>
    openxr_loader_library = ctypes.cdll.LoadLibrary(library_path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/osx/.local/lib/python3.8/site-packages/xr/library/libopenxr_loader.so)

Is it not possible to use on Ubuntu 20.04 which has GLIBC version 2.31?

cmbruns commented 12 months ago

I probably built the libraries on Ubuntu 22 last time, when I should have used my Ubuntu 18 VM, for better backward compatibility.

I just now made a new release that will probably work better on Ubuntu 20. I also added Ubuntu 20.04 to the continuous integration test matrix, so that should hopefully catch problems like this in the future.

@cambel could you please try the latest release and report back whether you get any further?

cambel commented 11 months ago

@cmbruns Thank you, now I can import the library. However I am stuck with the error "The loader was unable to find or load a runtime."

I have SteamVR server running and I can connect using pyOpenVR but with pyOpenXR it does not connect. Is there some configuration that I need to do before running pyOpenXR?

Error [GENERAL |  | OpenXR-Loader] : RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - unknown error
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - failed to load a runtime
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : Failed loading runtime information
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : xrCreateInstance failed
Traceback (most recent call last):
  File "openxr_test.py", line 4, in <module>
    instance = xr.create_instance(create_info=xr.InstanceCreateInfo())
  File "/usr/local/lib/python3.8/dist-packages/xr/functions.py", line 102, in create_instance
    raise result
xr.exception.RuntimeUnavailableError: The loader was unable to find or load a runtime.
cmbruns commented 11 months ago

If you run SteamVR and select the menu at the upper left, go to Settings, then OpenXR. Does it say the current OpenXR runtime is SteamVR?