bensondaled / pseyepy

PSEye-py: a python interface to the PS3Eye camera
Apache License 2.0
78 stars 26 forks source link

Problems compiling... undefined symbol: libusb_clear_halt (maybe it's not compiled the right way?) #1

Closed ThiagoNicolielo closed 5 years ago

ThiagoNicolielo commented 6 years ago

Hi!,

I am using Ubuntu 16.04 and Python 3.6.1 with anaconda environment

Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux

I know that's problematic and as each machine/environment/configurations are different, so, sometimes it is very difficult to solve individual problems, but I had several problems trying to compile and using / importing pseyepy.

import pseyepy from pseyepy import cameras Traceback (most recent call last): File "", line 1, in ImportError: /home/thiago/anaconda3/envs/envSpyderPython3.6/lib/python3.6/site-packages/UNKNOWN-0.0.0-py3.6-linux-x86_64.egg/pseyepy/cameras.cpython-36m-x86_64-linux-gnu.so: undefined symbol: libusb_clear_halt

Have any sugestions?

Thanks in advance and anyway, for your kindness sharing your work!

bensondaled commented 6 years ago

This strikes me on first glance as a libusb version issue. I know that functions have been removed or changed in different versions, though it does appear you're using 1.0... maybe this is a specific platform-dependent difference, as I'm on macOS.

Libusb does appear to implement libusb_clear_halt (http://libusb.sourceforge.net/api-1.0/group__dev.html#ga5b321176ce7f18cfec369dd3ab7d431e), so maybe it's worth trying a fresh download and re-install of libusb?

Happy to hear you're trying to get this going!

bensondaled commented 6 years ago

You may want to try installing again. I've redone how the package installs, just forcing it to compile and link to a fresh version of libusb, so it might work (though haven't tested on linux)

christophergeek commented 5 years ago

@ThiagoNicolielo did you ever fix this issue? I'm getting the same problem

bensondaled commented 5 years ago

I still haven't managed to replicate it on my own setup. Are you on Ubuntu as well? And did you use the libusb that I packaged with the repo? If you did, maybe try linking to a separate dedicated libusb? I suspect right now that it's an inconsistency between libusb versions across the OS's

christophergeek commented 5 years ago

Thanks for your reply. I was using the libusb in the repo yeah.

I managed to get it working by adding 'udev' to the libs variable in setup.py (got from here: https://stackoverflow.com/questions/12140859/import-hid-in-python-results-in-error-hid-so-undefined-symbol-libusb-open). I think I also had to remove the two -stdlib=libc++ flags in setup.py to get the compilation to finish.

bensondaled commented 5 years ago

Great, thanks!