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

Linux - expects to find 64bit library #26

Closed
mungewell opened this issue Dec 1, 2016 · 9 comments
Closed

Linux - expects to find 64bit library #26

mungewell opened this issue Dec 1, 2016 · 9 comments

Comments

@mungewell
Copy link

SteamVR can be installed under the Linux client, looks like pyopenvr expects library to be 64bit... when it isn't (at least on my machine).

simon@morkmobile:~/pyopenvr-git$ python src/samples/hello.py
Traceback (most recent call last):
  File "src/samples/hello.py", line 5, in <module>
    import openvr
  File "/usr/local/lib/python2.7/dist-packages/openvr/__init__.py", line 39, in <module>
    _openvr = cdll.LoadLibrary(_openvr_lib_name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libopenvr_api_64.so: cannot open shared object file: No such file or directory
simon@morkmobile:~/pyopenvr-git$ dpkg --list | grep steam
ii  steam-launcher                         1.0.0.53                                      all          Launcher for the Steam software distribution service
simon@morkmobile:~/pyopenvr-git$ find ~/.local/ -name 'libopenvr*'
/home/simon/.local/share/Steam/ubuntu12_32/libopenvr_api.so
@cmbruns-hhmi
Copy link
Collaborator

The file "libopenvr_api_64.so" should be installed with pyopenvr, in the same folder as init.py. The openvr project provides only a 64-bit linux library; no 32-bit version at the moment. https://github.com/ValveSoftware/openvr/tree/master/bin PyOpenVR uses its own copy of the openvr api shared library, so it would match the exact version of the API wrapped by the python binding.

I wonder whether setting LD_LIBRARY_PATH could help sidestep this problem.

Did you install pyopenvr via "pip install pyopenvr"?

Are you running 64-bit python?

Sorry I have not been testing pyopenvr on Linux. Your help in sorting out these issues is appreciated.

@eric-schleicher
Copy link

I'm interested in getting this to work as well. Attempting to create a ros node based on this library.

Am i understanding it correctly that i would need to make a copy of the libopenvr_api_64.so file in the same folder as this library?

willing to try.

Please advise.

@cmbruns
Copy link
Owner

cmbruns commented Mar 28, 2017

@eric-schleicher Are you trying to use pyopenvr on a 32-bit linux system? That's what this issue is about.

If you have somehow obtained a 32-bit openvr shared library, you could experiment with naming it libopenvr_api_32.so, and placing it in the pyopenvr folder. Unfortunately pyopenvr has not been well tested even on 64-bit linux systems. But you might find some enlightenment in issue #5 #5 (comment)

Have you at least got regular C++ openvr code working on your linux machine, and are now trying to get pyopenvr working?

@eric-schleicher
Copy link

eric-schleicher commented Mar 29, 2017 via email

@eric-schleicher
Copy link

ok, i did end up running into this exact despite being on x64 ubuntu 16.04LTS and useing python3.5 with pip3 to perform the install.

image

I was able to get it to run on windows; and i was just reproducing the logical steps on linux, which is my target platform.

Now following the comment on issue #5. will update if i find a solution

@claytmcneil
Copy link

I ran into an issue loading the library as well. The problem is that the mechanism used to load the library does not look at PATH, but rather looks at LD_LIBRARY_PATH. However, since that particular variable has to be set before python is invoked, there's not way (that I can tell) to set it in the script.

So rather than trying to set a PATH, I just changed the script to use an absolute path when on Linux.

@kazoo-kmt
Copy link

Hi @claytmcneil, I'm having a trouble including the PATH (I described the detail here #5 (comment)). Could you share the process you took in detail and the potential solution for this issue?

@claytmcneil
Copy link

@kazoo-kmt Rather then set the PATH, I specified the full path of the lib in the open. Under openvr/init.py, I modified last line of the snippet below:

# Add current directory to PATH, so we can load the DLL from right here. os.environ['PATH'] += os.pathsep + os.path.dirname(__file__) _openvr = cdll.LoadLibrary(os.path.join("/absolute/path/to/library", _openvr_lib_name))

@cmbruns
Copy link
Owner

cmbruns commented Feb 21, 2019

Fixed by fix for #36

@cmbruns cmbruns closed this as completed Feb 21, 2019
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

6 participants