import error running picam on a raspberry pi

0

I am trying to run picam on my raspberry pi. Unfortunately I am not getting around the following import error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-ae50f21e1c18> in <module>()
----> 1 import picam
      2 import time

/usr/local/lib/python2.7/dist-packages/picam/__init__.py in <module>()
      1 # Copyright (c) 2013 Sean Ashton
      2 # Licensed under the terms of the MIT License (see LICENSE.txt)
----> 3 from _picam import *
      4 import StringIO
      5 from PIL import Image

ImportError: /usr/local/lib/python2.7/dist-packages/picam/_picam.so: cannot open shared object file: No such file or directory

I have been looking all over the place (e.g.: cannot open shared object file: No such file or directory), but so far without success. Recompiling also did not work due to a whole bunch of missing libraries(mmal.h, vcos.h etc.)

update:

pi@raspberrypi ~ $ ls -l /usr/local/lib/python2.7/dist-packages/picam
total 48                                                                    
-rw-r--r-- 1 root staff  1819 Nov 18 14:47 __init__.py                      
-rw-r--r-- 1 root staff  2903 Nov 21 23:29 __init__.pyc                     
-rw-r--r-- 1 root staff 39567 Nov 18 14:47 _picam.so   

update2:

pi@raspberrypi ~ $ ldd /usr/local/lib/python2.7/dist-packages/picam/_picam.so
    not a dynamic executable

update3:

pi@raspberrypi ~ $ file /usr/local/lib/python2.7/dist-packages/picam/_picam.so 

/usr/local/lib/python2.7/dist-packages/picam/_picam.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xe403bf379f8c1dc2cb82df774ac3f11998661ff1, not stripped

readelf -d /usr/local/lib/python2.7/dist-packages/picam/_picam.so 

Dynamic section at offset 0x700c contains 37 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libmmal_core.so]
 0x00000001 (NEEDED)                     Shared library: [libmmal_util.so]
 0x00000001 (NEEDED)                     Shared library: [libmmal_vc_client.so]
 0x00000001 (NEEDED)                     Shared library: [libvcos.so]
 0x00000001 (NEEDED)                     Shared library: [libbcm_host.so]
 0x00000001 (NEEDED)                     Shared library: [libpython2.7.so.1.0]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libvchiq_arm.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [_picam.so]
 0x0000000f (RPATH)                      Library rpath: [/home/pi/SOURCE/userland/build/lib]
 0x0000000c (INIT)                       0x1d88
 0x0000000d (FINI)                       0x5840
 0x00000019 (INIT_ARRAY)                 0xf000
 0x0000001b (INIT_ARRAYSZ)               4 (bytes)
 0x0000001a (FINI_ARRAY)                 0xf004
 0x0000001c (FINI_ARRAYSZ)               4 (bytes)
 0x00000004 (HASH)                       0xf8
 0x6ffffef5 (GNU_HASH)                   0x444
 0x00000005 (STRTAB)                     0xcbc
 0x00000006 (SYMTAB)                     0x5bc
 0x0000000a (STRSZ)                      2330 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0xf154
 0x00000002 (PLTRELSZ)                   712 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x1ac0
 0x00000011 (REL)                        0x16f8
 0x00000012 (RELSZ)                      968 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x16b8
 0x6fffffff (VERNEEDNUM)                 2
 0x6ffffff0 (VERSYM)                     0x15d6
 0x6ffffffa (RELCOUNT)                   114
 0x00000000 (NULL)                       0x0

Any help would be greatly appreciated!

python
raspberry-pi
importerror
asked on Stack Overflow Nov 22, 2013 by Marco Pashkov • edited May 23, 2017 by Community

1 Answer

1

The package should have included the shared object file when installing via PIP. It's not ideal, but you can download it yourself from github and place it in the required folder. Or, you can trying reinstalling from PIP. https://github.com/ashtons/picam/tree/master/picam

What does the output of ls -l /usr/local/lib/python2.7/dist-packages/picam look like on your pi?

answered on Stack Overflow Nov 22, 2013 by VooDooNOFX

User contributions licensed under CC BY-SA 3.0