[英]import error running picam on a raspberry pi
I am trying to run picam on my raspberry pi. 我正在尝试在树莓派上运行picam 。 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 (eg: 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.) 由于缺少一堆库(mmal.h,vcos.h等),重新编译也无法正常工作
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: 更新2:
pi@raspberrypi ~ $ ldd /usr/local/lib/python2.7/dist-packages/picam/_picam.so
not a dynamic executable
update3: 更新3:
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 /usr/local/lib/python2.7/dist-packages/picam/_picam.so:ELF 32位LSB共享对象,ARM,版本1(SYSV),动态链接,BuildID [sha1] = 0xe403bf379f8c1dc2cb82df774ac3f11998661ff1,未剥离
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! 任何帮助将不胜感激!
The package should have included the shared object file when installing via PIP. 通过PIP安装时,该软件包应包括共享库文件。 It's not ideal, but you can download it yourself from github and place it in the required folder. 这并不理想,但是您可以自己从github下载它,并将其放在所需的文件夹中。 Or, you can trying reinstalling from PIP. 或者,您可以尝试从PIP重新安装。 https://github.com/ashtons/picam/tree/master/picam 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? 在pi上, ls -l /usr/local/lib/python2.7/dist-packages/picam
的输出是什么样的?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.