OSError: libev.so.4: cannot open shared object file: No such file or directory

Ubuntu12.04 下使用pyev 模块,但是运行sudo python setup.py install后却提示出现以下错误:

Traceback (most recent call last):

File "setup.py", line 59, in <module>

check_version(libev_version(), min_libev_version, "libev")

File "setup.py", line 50, in libev_version

libev_dll = cdll.LoadLibrary(libev_dll_name)

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)

很显然是缺少共享库文件,但是当我去/usr/local/lib下查找时,确发现有libev.so.4这个文件,那就是共享库搜索路径不对的问题,然后再去查看系统的共享库搜索路径配置,/etc/ld.so.conf, 发现里面只有一句 include /etc/ld.so.conf.d/*.conf,然后再去查看/etc/ld.so.conf.d/下的文件,发现libc.conf中已经包括了/usr/local/lib这个路径,那么问题来了,通过include包括文件的方法本应可以把/usr/local/lib这条路径包括近来的,看来是python的ctypes.cdll.LoadLibray()这里出了问题。查看python官网上ctypes模块部分,给出"On
Linux, find_library() tries to run external programs(/sbin/ldconfig,
gcc, and
objdump
) to find the library file. Itreturns the filename of the library file",这里选使用ldconfig的默认搜索路径,而ldconfig默认搜索路径是/usr,/usr/lib,和/etc/ld.so.conf中列出的路径,所以应该是把/usr/local/lib这条路径直接添加到/etc/ld.so.conf的新行中,然后sudo ldconfig使之生效,这样就确保了ctypes相关方法可以找到共享库的正确的搜索路径。然后再sudo
python setup.py install就可以成功了。

时间: 2024-08-25 12:12:25

OSError: libev.so.4: cannot open shared object file: No such file or directory的相关文章

linux 生成动态库时提示relocation R_X86_64_32 against `.rodata&#39; can not be used when making a shared object;

linux生成动态库时遇到了relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC错误. 由于我的系统是AMD64位的,所以需要在编译的时候添加 -fPIC选项 解决方法: 例如: g++ -c -fPIC head.cpp    生成head.o g++ -fpic -shared -o libfun.so head.o linux 生成

ogg启动报错libnnz11.so: cannot open shared object file

当ogg软件解压,并给予正确的权限后,在启动ogg时会遇到如下报错: [[email protected] ogg]# ./ggsci./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory 这里是因为缺少libnnz11.so库文件造成的,需要给出此库文件的位置,解决如下: [Oracle@oggtest ogg]$

libuuid.so: cannot open shared object file: No such file or directory

在玩ngx-lua时候有个 resty-uuid 需要引用 libuuid.so 动态库 打印log提示信息是这样的: libuuid.so: cannot open shared object file: No such file or directory 解决方案: [[email protected] ~]#yum install libuuid libuuid-devel [[email protected] ~]#ln -s /lib64/libuuid.so.1.3.0 /usr/l

ArchLinux 下 virtualbox 报错 libQtCore.so.4: cannot open shared object file

VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/lib/virtualbox/VirtualBox.so",) failed: libQtCore.so.4: cannot open shared object file: No such file or directory

gcc报错 can not be used when making a shared object; recompile with -fPIC

使用google protobuf时,出现错误 /usr/bin/ld: /usr/local/lib/libprotobuf.a(message_lite.o): relocation R_X86_64_32S against `_ZTVN6google8protobuf11MessageLiteE' can not be used when making a shared object; recompile with -fPIC/usr/local/lib/libprotobuf.a: er

ubuntu解决libstdc++.so.6: cannot open shared object file: No such file or directory:问题

解决libstdc++.so.6: cannot open shared object file: No such file or directory:原因在于,在13.10 版本中,ia32_libs 被废弃了导致没有32位的lib库.解决方法sudo apt-get install lib32stdc++6sudo apt-get install lib32z1

libdb2.so.1: cannot open shared object file: No such file or directory

[[email protected] bin]# ./dsmserv ./dsmserv: error while loading shared libraries: libdb2.so.1: cannot open shared object file: No such file or directory [[email protected] bin]# pwd /opt/tivoli/tsm/server/bin Resolving the problem The below steps m

OGG登陆报cannot open shared object file错误处理

1.错误现象 Linux服务器上,新安装的goldengate(OGG),使用./ggsci登 陆控制台报出./ggsci: error while loading shared libraries: libnnz11.so: cannotopen shared object file: No such file or directory错误. 2.原因分析 因为运行OGG的用户的没有设置LD_LIBRARY_PATH环境变量,或设置不正确所致. 3.解决方法: 在.bash_profile中增

gcc编译参数-fPIC问题 `a local symbol&#39; can not be used when making a shared object;

gcc -shared -o hack.so hack.c/usr/bin/ld: /tmp/ccUZREwA.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC/tmp/ccUZREwA.o: could not read symbols: Bad valuecollect2: ld returned 1 exit