简体   繁体   中英

cannot open shared object file: No such file or directory in raspberry pi with python

Here I am trying to import 'libEpsonFiscalDriver.so' file in raspberry pi using python 2.7. Here are my steps in python

>>>import ctypes
>>>ctypes.cdll.LoadLibrary('/home/pi/odoo/my_module/escpos/lib/libEpsonFiscalDriver.so')
Traceback (most recent call last):
      File "", line 1, in 
      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: /home/pi/odoo/my_module/escpos/lib/libEpsonFiscalDriver.so: cannot open shared object file: No such file or directory

So here I am getting this error.

Extra Information: Header Information of libEpsonFiscalDriver.so file.

readelf -h libEpsonFiscalDriver.so

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x5de0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          125176 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         7
  Size of section headers:           40 (bytes)
  Number of section headers:         29
  Section header string table index: 26

For more, I have tested this same code with my other system with Ubuntu installed having Intel Processor and it works fine there. As, lib header listed Machine as Intel 80386. I dought that this lib will only work with Intel Architecture. Is it the thing or am I missing something?

Any help will be more than appreciated! Thank you.

The lib is not compatible with Raspberry Pi as the architectures are different. You need to find an ARM based version of that driver if you want to use it on the Pi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM