cmbruns / pyopenvr

Unofficial python bindings for Valve's OpenVR virtual reality SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not find module 'libopenvr_api_64'.

MrAlexEsisteGia opened this issue · comments

Windows 10
Python 3.8.0

I'm using the README.md example

But when i try to run it i get:
Traceback (most recent call last): File "C:\Users\ale54\Desktop\pyopenvrstuff\sas.py", line 3, in <module> import openvr File "C:\Users\ale54\AppData\Local\Programs\Python\Python38\lib\site-packages\openvr\__init__.py", line 58, in <module> _openvr = cdll.LoadLibrary(_openvr_lib_name) File "C:\Users\ale54\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 447, in LoadLibrary return self._dlltype(name) File "C:\Users\ale54\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 369, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'libopenvr_api_64'. Try using the full path with constructor syntax.

@MrAlexEsisteGia How did you install pyopenvr?
Could you try it with Python 3.7.x?

Oh going back to 3.7.5 fixed the problem
Thanks!
Also i installed it with pip3 install openvr

Just for the record. I believe the problem is not in pyopenvr per se, but in (probably) breaking change in ctypes.CDLL implementation. I have been hit by similar behavior on another project, which also uses ctypes to interface with the native DLL (https://github.com/randombit/botan), when I was trying to run it in Python 3.9 (dev branch).

Disclaimer: Im new(started a few days ago) to python so im probably 95% wrong
I think it's the fact that the new CDLL change they deprecated the old method without realizing that they broke it ??

also, are you italian by any chance?

in pyopenvr per se,

I think it's the fact that the new CDLL change they deprecated the old method without realizing that they broke it ??

Python 3.8 changed the method the DLLs are loaded in Windows and made it independent on PATH environment variable. The code which needs to load a DLL from "non-standard" place (i.e. its own directory) has to use a different approach to add this directory to the loader search path.

BTW: per se comes from Latin and is also used in other languages (so I am not Italian ;-))

Oh, i get it, that makes a lot more sense, thanks for explaning me that!