背景

  • 想使用 ningx + uwsgi + flask 搭建 python 应用环境
  • Python使用的是anaconda3(pyhton 3.6)
  • 依赖包安装完毕,但是执行 uwsgi 的时候出现如下异常
(py3) [root@localhost ~]# uwsgi
uwsgi: error while loading shared libraries: libicui18n.so.58: cannot open shared object file: No such file or directory

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

(py3) [root@localhost ~]# which uwsgi
/root/anaconda3/envs/py3/bin/uwsgi
(py3) [root@localhost ~]# 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) [root@localhost ~]# ln -s /root/anaconda3/lib/libicui18n.so.58 /lib64/libicui18n.so.58
(py3) [root@localhost ~]# ln -s /root/anaconda3/lib/libicuuc.so.58 /lib64/libicuuc.so.58
(py3) [root@localhost ~]# ln -s /root/anaconda3/lib/libicudata.so.58 /lib64/libicudata.so.58

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

(py3) [root@localhost ~]# 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 命令查看结果如下

[root@localhost 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) [root@localhost 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 异常处理的更多相关文章

  1. 解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

    问题现象: 执行ffmpeg命令后报错: ffmpeg: error : cannot open shared object file: No such file or directory 出问题的环 ...

  2. ggsci: error while loading shared libraries: libnnz11.so

    [oracle@localhost goldengate]$ ./ggsci ./ggsci: error while loading shared libraries: libnnz11.so: c ...

  3. ogg-./ggsci ./ggsci: error while loading shared libraries: libnnz11.so:

    测试环境,安装linux 0gg,解压介质后./ggsci无法使用,提示目录不存在 原来是环境变量导致的问题: 1.报错现象 [ogg@enmo ogg]$ ./ggsci ./ggsci: erro ...

  4. linux使用wkhtmltopdf报错error while loading shared libraries:

    官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在li ...

  5. python3: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

    安装python3遇到报错: wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz ./configure --prefix=/u ...

  6. error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

    zabbix3.2启动有如下报错: # service zabbix_server startStarting zabbix_server:  /home/zabbix-server/sbin/zab ...

  7. 错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

    执行以下代码,生成唯一的UID $fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = frea ...

  8. ebs r12 -- adadmin: error while loading shared libraries: libclntsh.so.10.1

    安装EBS R12.2增加中文字符集时,运行$AU_TOP/bin/adadmin出错: $ adadmin adadmin: error while loading shared libraries ...

  9. 【转】error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

    错误信息: /usr/local/memcacheq/bin/memcacheq: error while loading shared libraries: libevent-2.0.so.5: c ...

随机推荐

  1. USB转串口 FT232/PL2303芯片使用体会

    现在笔记本上很少带有串口了,而串口又是做电子设计必备的通讯接口之一,好在USB转串口比较方便,市面上常用的USB转串口芯片有很多,最常见的有FT232.PL2303.CH340三种 原理:单片机的TX ...

  2. 揭开Python科学计算的面纱

    春牛春杖.无限春风来海上.便与春工.染得桃红似肉红. 春幡春胜.一阵春风吹酒醒.不似天涯.卷起杨花似雪花. 标准的Python中用列表保存一组值,可以当做数组使用,但是由于其值类型任意,所以列表中保存 ...

  3. Github配置SSH连接

    安装git.exe,打开Git Bash 1.检查是否已经有SSH Key. $cd /.ssh 2.生成一个新的SSH. $ ssh-keygen -t rsa -C "email@git ...

  4. python堆排序实现TOPK问题

    # 构建小顶堆跳转def sift(li, low, higt): tmp = li[low] i = low j = 2 * i + 1 while j <= higt: # 情况2:i已经是 ...

  5. 514 Freedom Trail 自由之路

    详见:https://leetcode.com/problems/freedom-trail/description/ C++: class Solution { public: int findRo ...

  6. 125 Valid Palindrome 验证回文字符串

    给定一个字符串,确定它是否是回文,只考虑字母数字字符和忽略大小写.例如:"A man, a plan, a canal: Panama" 是回文字符串."race a c ...

  7. CentOS 6.9:MySQL Daemon failed to start.

    [root@Server_1 12:02:58 ~ 25]#service mysqld start MySQL Daemon failed to start.Starting mysqld: [ro ...

  8. ref 和 React.js 中的 DOM 操作

    在 React.js 当中你基本不需要和 DOM 直接打交道.React.js 提供了一系列的 on*方法帮助我们进行事件监听,所以 React.js 当中不需要直接调用 addEventListen ...

  9. 【转】javap -c命令详解

    javap -c命令详解 一直在学习Java,碰到了很多问题,碰到了很多关于i++和++i的难题,以及最经典的String str = "abc" 共创建了几个对象的疑难杂症. 知 ...

  10. flutter基础

    1.flutter安装 1.参考官网安装sdk https://flutter.io/get-started/install 安卓和IOS需要分别配置对应的开发环境,安卓建议使用as开发,安装Flut ...