Re: [pywws] OSError: libhidapi-libusb.so.0: cannot open shared object file: No such file or directory

1,582 views
Skip to first unread message

Jim Easterbrook

unread,
May 18, 2013, 2:03:29 PM5/18/13
to py...@googlegroups.com
On 18/05/13 18:34, brunobulox wrote:
> I am getting this error when trying to run pywws... I am pretty sure I
> have correctly installed the dependencies ...
>
> Detail:
>
> ~/work/pywws/code $ python TestWeatherStation.py
> Traceback (most recent call last):
> File "TestWeatherStation.py", line 179, in <module>
> sys.exit(main())
> File "TestWeatherStation.py", line 114, in main
> ws = WeatherStation.weather_station()
> File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 394, in
> __init__
> self.cusb = CUSBDrive()
> File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 301, in
> __init__
> from .device_ctypes_hidapi import USBDevice
> File "/home/pi/work/pywws/code/pywws/device_ctypes_hidapi.py", line
> 97, in <module>
> hidapi = ctypes.CDLL(path)
> File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
> self._handle = _dlopen(self._name, mode)
> OSError: libhidapi-libusb.so.0: cannot open shared object file: No such
> file or directory

Hmm, this could be a problem with LD_LIBRARY_PATH or similar. I hate those.

Try finding the file directly:

find /usr -name libhidapi-libusb.so.0 -ls

If this finds the file, temporarily add the directory it's in to
LD_LIBRARY_PATH:

export LD_LIBRARY_PATH = dir_name:$LD_LIBRARY_PATH

Then try TestWeatherStation.py again.

After that it's over to the Raspberry Pi experts...
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

brunobulox

unread,
May 18, 2013, 2:04:07 PM5/18/13
to py...@googlegroups.com
Getting further...

I symlinked /usr/local/lib/libhidapi-libusb.so.0 to /usr/lib/libhidapi-libusb.so.0 and it seems to find it... Now I am hitting,

pi@raspberrypi ~/work/pywws/code $ python TestWeatherStation.py

Traceback (most recent call last):
  File "TestWeatherStation.py", line 179, in <module>
    sys.exit(main())
  File "TestWeatherStation.py", line 114, in main
    ws = WeatherStation.weather_station()
  File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 394, in __init__
    self.cusb = CUSBDrive()
  File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 317, in __init__
    self.dev = USBDevice(0x1941, 0x8021)
  File "/home/pi/work/pywws/code/pywws/device_ctypes_hidapi.py", line 114, in __init__
    raise IOError("Weather station device not found")
IOError: Weather station device not found


What am I missing here...?

thanx,
mark


On Saturday, May 18, 2013 1:34:36 PM UTC-4, brunobulox wrote:
I am getting this error when trying to run pywws... I am pretty sure I have correctly installed the dependencies ...

Detail:

~/work/pywws/code $ python TestWeatherStation.py
Traceback (most recent call last):
  File "TestWeatherStation.py", line 179, in <module>
    sys.exit(main())
  File "TestWeatherStation.py", line 114, in main
    ws = WeatherStation.weather_station()
  File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 394, in __init__
    self.cusb = CUSBDrive()
  File "/home/pi/work/pywws/code/pywws/WeatherStation.py", line 301, in __init__
    from .device_ctypes_hidapi import USBDevice
  File "/home/pi/work/pywws/code/pywws/device_ctypes_hidapi.py", line 97, in <module>
    hidapi = ctypes.CDLL(path)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libhidapi-libusb.so.0: cannot open shared object file: No such file or directory


Also I do see the weather station on usb:

pi@raspberrypi ~/work/pywws $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 005: ID 1941:8021 Dream Link WH1080 Weather Station / USB Missile Launcher


If anyone has any suggestions I would really appreciate it...

thanx...

brunobulox

unread,
May 18, 2013, 2:06:38 PM5/18/13
to py...@googlegroups.com
Solved.. after symlinking the lib and running as root it worked..thanks for enduring my babbling...

Sourabh Gupta

unread,
Jul 14, 2014, 6:45:38 AM7/14/14
to py...@googlegroups.com
File does not exit on above loc. What I need to do Jim? 

Jim Easterbrook

unread,
Jul 14, 2014, 12:03:31 PM7/14/14
to py...@googlegroups.com
Either correctly install hidapi and all its dependencies, or forget about hidapi and install pyusb (python-usb is the name 'apt-get' uses) instead.
--
You received this message because you are subscribed to the Google Groups "pywws" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pywws+un...@googlegroups.com.
To post to this group, send email to py...@googlegroups.com.
Visit this group at http://groups.google.com/group/pywws.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages