libphidget22.so.0.0.0: cannot open shared object file

Supporting 2.6 and up
DamianBusz
Phidgetsian
Posts: 6
Joined: Mon Jul 24, 2017 5:52 am
Contact:

libphidget22.so.0.0.0: cannot open shared object file

Post by DamianBusz »

Hi there.
I have a problem with running python example scripts.

Here is an outcome from installing libs

Code: Select all

libphidget22:i386 is already the newest version (99:1.0.0.20170720-1+deb8).
libphidget22-dev:i386 is already the newest version (99:1.0.0.20170720-1+deb8).
libphidget22java:i386 is already the newest version (99:1.0.0.20170720-1+deb8).
phidget22admin:i386 is already the newest version (99:1.0.0.20170720-1+deb8).
phidget22networkserver:i386 is already the newest version (99:1.0.0.20170720-1+deb8).
Here is the error I get while trying to run the script:

Code: Select all

OSError: libphidget22.so.0.0.0: cannot open shared object file: No such file or directory
I have installed Phidget22 setup.py

Any idea whats going on?
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by Patrick »

You are running 32-bit Debian 8? Can you confirm that libphidget22.so.0.0.0 exists in /usr/lib/i386-linux-gnu

-Patrick
DamianBusz
Phidgetsian
Posts: 6
Joined: Mon Jul 24, 2017 5:52 am
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by DamianBusz »

Thanks for your reply Patrick.

Here is a little about my archiecture:

Code: Select all

Linux damian-ThinkPad-T520 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Yes, I can confirm that libphidget22.so.0.0.0 exists in /usr/lib/i386-linux-gnu

I believe my architecture can be a problem in this case?
DamianBusz
Phidgetsian
Posts: 6
Joined: Mon Jul 24, 2017 5:52 am
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by DamianBusz »

I figured out there is no support for my distribution.

Code: Select all

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
Also its amd64.

Anything I can possibly do?
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by Patrick »

You need to install from source rather then using the packages. We will offer 64-bit packages in the future but right now, they are 32-bit only.

See: https://www.phidgets.com/docs/OS_-_Linu ... ic_install
DamianBusz
Phidgetsian
Posts: 6
Joined: Mon Jul 24, 2017 5:52 am
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by DamianBusz »

Dear Patrick,
I did install them manually and yet no succes on progress.

Code: Select all

damian@damian-ThinkPad-T520:~/dev/Phidget$ python3 RFID.py
Traceback (most recent call last):
  File "RFID.py", line 9, in <module>
    ch = RFID()
  File "/usr/local/lib/python3.5/dist-packages/Phidget22/Devices/RFID.py", line 30, in __init__
    __func = PhidgetSupport.getDll().PhidgetRFID_create
  File "/usr/local/lib/python3.5/dist-packages/Phidget22/PhidgetSupport.py", line 17, in getDll
    PhidgetSupport.__dll = cdll.LoadLibrary("libphidget22.so.0.0.0")
  File "/usr/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libphidget22.so.0.0.0: cannot open shared object file: No such file or directory
Exception ignored in: <bound method RFID.__del__ of <Phidget22.Devices.RFID.RFID object at 0x7fe2fb1be128>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/Phidget22/Devices/RFID.py", line 40, in __del__
    Phidget.__del__(self)
  File "/usr/local/lib/python3.5/dist-packages/Phidget22/Phidget.py", line 53, in __del__
    __func = PhidgetSupport.getDll().Phidget_delete
  File "/usr/local/lib/python3.5/dist-packages/Phidget22/PhidgetSupport.py", line 17, in getDll
    PhidgetSupport.__dll = cdll.LoadLibrary("libphidget22.so.0.0.0")
  File "/usr/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libphidget22.so.0.0.0: cannot open shared object file: No such file or directory
I wish there would be a solution to my problem.
Every library installed succesful
thinwybk
Fresh meat
Posts: 3
Joined: Fri Jul 28, 2017 1:22 am
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by thinwybk »

I installed the libraries like described in the https://www.phidgets.com/docs/OS_-_Linu ... ic_install section on Ubuntu 14.04.5 LTS (trusty), 64-bit. But I have the exact same issue when running the DigitalOutput.py example:

Code: Select all

kromer@rc-019:~/Downloads$ python DigitalOutput.py
Traceback (most recent call last):
  File "DigitalOutput.py", line 9, in <module>
    ch = DigitalOutput()
  File "/usr/local/lib/python2.7/dist-packages/Phidget22/Devices/DigitalOutput.py", line 28, in __init__
    __func = PhidgetSupport.getDll().PhidgetDigitalOutput_create
  File "/usr/local/lib/python2.7/dist-packages/Phidget22/PhidgetSupport.py", line 17, in getDll
    PhidgetSupport.__dll = cdll.LoadLibrary("libphidget22.so.0.0.0")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libphidget22.so.0.0.0: cannot open shared object file: No such file or directory
Exception OSError: OSError('libphidget22.so.0.0.0: cannot open shared object file: No such file or directory',) in <bound method DigitalOutput.__del__ of <Phidget22.Devices.DigitalOutput.DigitalOutput instance at 0x7f2ddb6d6950>> ignored
When running the C example everything seems to work fine:

Code: Select all

kromer@rc-019:~/Downloads/DigitalOutput_Example/Standard$ ./example 
INFO [_phidget22usb][2017-07-28T09:35:14]:Initializing libusb
INFO [_phidget22usb][2017-07-28T09:35:14]:New Phidget found in PhidgetUSBBuildList: 1/18
INFO [_phidget22usb][2017-07-28T09:35:14]:Using Control Endpoint for Host->Device communication.
INFO [phidget22][2017-07-28T09:35:14 usb.c+391 PhidgetUSBReadThreadFunction()]: PhidgetInterfaceKit 0/0/8(1017) (439227): ReadThread starting
channel 0 on device 439227 hub port 0 attached
Setting State to 1 for 5 seconds...
Setting State to 0 for 5 seconds...
INFO [_phidget22usb][2017-07-28T09:35:24]:
channel 0 on device 439227 detached
INFO [phidget22][2017-07-28T09:35:24 usb.c+458 PhidgetUSBReadThreadFunction()]: PhidgetInterfaceKit 0/0/8(1017) (439227): ReadThread exiting normally (Phidget detached)
INFO [_phidget22usb][2017-07-28T09:35:24]:Deinitializing libusb
In my case only the libphidget22java.so is located in /usr/lib:

Code: Select all

kromer@rc-019:~/Downloads/DigitalOutput_Example/Standard$ ll /usr/lib/ | grep libphidget
-rw-r--r--   1 root root      5204086 Jul 27 17:52 libphidget22java.a
-rwxr-xr-x   1 root root         1010 Jul 27 17:52 libphidget22java.la*
lrwxrwxrwx   1 root root           25 Jul 27 17:52 libphidget22java.so -> libphidget22java.so.0.0.0*
lrwxrwxrwx   1 root root           25 Jul 27 17:52 libphidget22java.so.0 -> libphidget22java.so.0.0.0*
-rwxr-xr-x   1 root root      2999134 Jul 27 17:52 libphidget22java.so.0.0.0*
libphidgete22.so.0.0 and libphidget22extra.so.0.0 are located in /usr/local/lib:

Code: Select all

kromer@rc-019:~/Downloads/DigitalOutput_Example/Standard$ ll /usr/local/lib/ | grep libphidget
-rw-r--r--  1 root root  15366786 Jul 27 18:38 libphidget22.a
-rw-r--r--  1 root root    278982 Jul 27 17:48 libphidget22extra.a
-rwxr-xr-x  1 root root      1052 Jul 27 17:48 libphidget22extra.la*
lrwxrwxrwx  1 root root        26 Jul 27 17:48 libphidget22extra.so -> libphidget22extra.so.0.0.0*
lrwxrwxrwx  1 root root        26 Jul 27 17:48 libphidget22extra.so.0 -> libphidget22extra.so.0.0.0*
-rwxr-xr-x  1 root root    155540 Jul 27 17:48 libphidget22extra.so.0.0.0*
-rwxr-xr-x  1 root root      1005 Jul 27 18:38 libphidget22.la*
lrwxrwxrwx  1 root root        21 Jul 27 18:38 libphidget22.so -> libphidget22.so.0.0.0*
lrwxrwxrwx  1 root root        21 Jul 27 18:38 libphidget22.so.0 -> libphidget22.so.0.0.0*
-rwxr-xr-x  1 root root   6193131 Jul 27 18:38 libphidget22.so.0.0.0*
Where the corresponding *.so files for phidget22networkserver and phidget22admin reside I do not know yet...
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by Patrick »

Looks like Python isn't looking in /usr/local/lib on Ubuntu.

Your options would be to either install libphidget22 in /usr/lib:

Code: Select all

./configure --prefix=/usr && make && sudo make install
Or ensure Python is looking in /usr/local/lib, either in the current session:

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
python DigitalOutput.py
Or permanently with ldconfig:

Code: Select all

Add /usr/local/lib to /etc/ld.so.conf
sudo ldconfig
thinwybk
Fresh meat
Posts: 3
Joined: Fri Jul 28, 2017 1:22 am
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by thinwybk »

Patrick wrote:Looks like Python isn't looking in /usr/local/lib on Ubuntu.
Right...
Patrick wrote:Your options would be to either install libphidget22 in /usr/lib:

Code: Select all

./configure --prefix=/usr && make && sudo make install
This is probably easiest. Are there any limitations to this solution (system/user wide installation, etc.)?
Patrick wrote:Or ensure Python is looking in /usr/local/lib, either in the current session:

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
python DigitalOutput.py
This solution is working fine.
Patrick wrote:Or permanently with ldconfig:

Code: Select all

Add /usr/local/lib to /etc/ld.so.conf
sudo ldconfig
This did not work in my setup: I added /usr/local/lib to /etc/ld.so.conf and run sudo ldconfig. When running

Code: Select all

ldconfig -p | grep phidget22
most libs seem to be in there (network and admin still missing)

Code: Select all

	libphidget22java.so.0 (libc6,x86-64) => /usr/lib/libphidget22java.so.0
	libphidget22java.so (libc6,x86-64) => /usr/lib/libphidget22java.so
	libphidget22extra.so.0 (libc6,x86-64) => /usr/local/lib/libphidget22extra.so.0
	libphidget22extra.so (libc6,x86-64) => /usr/local/lib/libphidget22extra.so
	libphidget22.so.0 (libc6,x86-64) => /usr/local/lib/libphidget22.so.0
	libphidget22.so (libc6,x86-64) => /usr/local/lib/libphidget22.so
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: libphidget22.so.0.0.0: cannot open shared object file

Post by Patrick »

phidgetadmin and phidget22networkserver are not libraries they are programs - should be in /usr/local/bin

-Patrick
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests