uwsgs loading shared libraries: libicui18n.so.58 异常处理

Posted 每天进步一点点!-码农

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了uwsgs loading shared libraries: libicui18n.so.58 异常处理相关的知识,希望对你有一定的参考价值。

背景

  • 使用是anaconda3
  • 依赖包安装完毕,但是执行 uwsgi 的时候出现如下异常
(py3) [[email protected] ~]# uwsgi
uwsgi: error while loading shared libraries: libicui18n.so.58: cannot open shared object file: No such file or directory

于是乎查看 uwsgi所在地址,然后使用 LDD 查看缺少的包

(py3) [[email protected] ~]# which uwsgi
/root/anaconda3/envs/py3/bin/uwsgi
(py3) [[email protected] ~]# ldd /root/anaconda3/envs/py3/bin/uwsgi
    linux-vdso.so.1 =>  (0x00007ffc14fc7000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff6b0347000)
    libm.so.6 => /lib64/libm.so.6 (0x00007ff6b0045000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007ff6afe40000)
    libpcre.so.1 => /lib64/libpcre.so.1 (0x00007ff6afbde000)
    libxml2.so.2 => /lib64/libxml2.so.2 (0x00007ff6af874000)
    libz.so.1 => /lib64/libz.so.1 (0x00007ff6af65d000)
    liblzma.so.5 => /lib64/liblzma.so.5 (0x00007ff6af437000)
    libicui18n.so.58 => not found
    libicuuc.so.58 => not found
    libicudata.so.58 => not found
    libutil.so.1 => /lib64/libutil.so.1 (0x00007ff6af233000)
    librt.so.1 => /lib64/librt.so.1 (0x00007ff6af02a000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ff6aedf3000)
    libc.so.6 => /lib64/libc.so.6 (0x00007ff6aea30000)
    /lib64/ld-linux-x86-64.so.2 (0x00005634c289c000)
    libfreebl3.so => /lib64/libfreebl3.so (0x00007ff6ae82c000)

通过 LDD 发现 uwsgi 找不到三个包(具体就是 not found 的三个)

于是就把anaconda3/lib 下相应的包软链到/lib64下去(64bit 机器,如果时32bit 机器则软链到/lib下

(py3) [[email protected] ~]# ln -s /root/anaconda3/lib/libicui18n.so.58 /lib64/libicui18n.so.58
(py3) [[email protected] ~]# ln -s /root/anaconda3/lib/libicuuc.so.58 /lib64/libicuuc.so.58
(py3) [[email protected] ~]# ln -s /root/anaconda3/lib/libicudata.so.58 /lib64/libicudata.so.58

这样缺失的三个包补充了,那么在使用ldd 测试结果如下

(py3) [[email protected] ~]# ldd /root/anaconda3/envs/py3/bin/uwsgi
/root/anaconda3/envs/py3/bin/uwsgi: /lib64/./libstdc++.so.6: version `CXXABI_1.3.8‘ not found (required by /lib64/libicui18n.so.58)
/root/anaconda3/envs/py3/bin/uwsgi: /lib64/./libstdc++.so.6: version `CXXABI_1.3.9‘ not found (required by /lib64/libicui18n.so.58)
/root/anaconda3/envs/py3/bin/uwsgi: /lib64/./libstdc++.so.6: version `CXXABI_1.3.8‘ not found (required by /lib64/libicuuc.so.58)
/root/anaconda3/envs/py3/bin/uwsgi: /lib64/./libstdc++.so.6: version `CXXABI_1.3.9‘ not found (required by /lib64/libicuuc.so.58)

这说明还是缺失CXXABI_ 之类的东西,使用 strings 命令查看结果如下

[[email protected] lib64]# strings /usr/lib64/libstdc++.so.6|grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1

确实没有CXXABI_1.3.8  CXXABI_1.3.9 之类的东西,那么就把 anaconda3 下的libstdc++.so.6移到/lib64下面, libstdc++.so.6就是libstdc++.so.6.0.24的软链(可以去/lib64下查看ll libstc*),既然确实那就把 anconda3下的高版本高 copy 过去就是

把libstdc++.so.6.0.24拷贝到/lib64目录下。
  cp libstdc++.so.6.0.24 /lib64/
删除原来的libstdc++.so.6符号连接。
  rm -rf libstdc++.so.6
新建新符号连接。
  ln -s libstdc++.so.6.0.24 libstdc++.so.6
再次执行查看结果符合就哦了。
(py3) [[email protected] lib64]# uwsgi
*** Starting uWSGI 2.0.17 (64bit) on [Fri May  4 16:07:20 2018] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 02 May 2018 11:23:18
os: Linux-3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017
nodename: localhost
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 6
current working directory: /usr/lib64
detected binary path: /root/anaconda3/envs/py3/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4096
your memory page size is 4096 bytes
detected max file descriptor number: 65536
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
The -s/--socket option is missing and stdin is not a socket.

 

以上是关于uwsgs loading shared libraries: libicui18n.so.58 异常处理的主要内容,如果未能解决你的问题,请参考以下文章

loading shared libraries: libaio.so.1: cannot open share

error while loading shared libraries: libiksemel.so.3: cannot open shared...

OracleOGG error while loading shared libraries

error while loading shared libraries: libreadline.so.5: cannot open shared object file:

error while loading shared libraries: libssl.so.6: cannot open shared object file

解决tpcc_load 报错 error while loading shared libraries: libmysqlclient.so.20