python - 未找到导入 MySQLdb 和 `GLIBC_2.14'

标签 python mysql centos mysql-python glibc

尝试运行导入 MySQLdb 的 Python 脚本。我运行了 yum update libgcrypt

Traceback (most recent call last):
  File "/var/www/python/ig/ig-post.py", line 12, in <module>
    import MySQLdb
  File "/usr/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/user/.linuxbrew/lib/libcrypt.so.1)

也可能有帮助:

# yum info libgcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.ircam.fr
 * epel: mirrors.ircam.fr
 * extras: centos.mirror.fr.planethoster.net
 * updates: centos.quelquesmots.fr
Installed Packages
Name        : libgcrypt
Arch        : x86_64
Version     : 1.4.5
Release     : 12.el6_8
Size        : 524 k
Repo        : installed
From repo   : base
Summary     : A general-purpose cryptography library
URL         : http://www.gnupg.org/
License     : LGPLv2+
Description : Libgcrypt is a general purpose crypto library based on the code used
            : in GNU Privacy Guard.  This is a development version.

Available Packages
Name        : libgcrypt
Arch        : i686
Version     : 1.4.5
Release     : 12.el6_8
Size        : 228 k
Repo        : base
Summary     : A general-purpose cryptography library
URL         : http://www.gnupg.org/
License     : LGPLv2+
Description : Libgcrypt is a general purpose crypto library based on the code used
            : in GNU Privacy Guard.  This is a development version.

最佳答案

您有一个本地构建的 /home/user/.linuxbrew/lib/libcrypt.so.1,它是在使用 GLIBC-2.14(或更新版本)的系统上构建的。

该库与您尝试运行的系统(具有 GLIBC-2.13 或更早版本)不兼容

您需要从 LD_LIBRARY_PATH(或您用来获取它的任何机制)中删除 /home/user/.linuxbrew/lib,或者删除 /home/user/.linuxbrew/lib/libcrypt.so.1 一共。

关于python - 未找到导入 MySQLdb 和 `GLIBC_2.14',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47410893/

相关文章:

python - 在 Pandas 中使用 groupby 时检查某些列的值

Python 使用按钮通过 tkinter GUI 循环字典项

php - Requires : httpd-mmn = 20051115 mean? Where can I adjust this setting 是什么意思?

centos - idn2.h : No such file or directory

apache - 无法在未找到 CentOS 私钥上启动 Apache

Python 多列表理解在一个列表中包含元组范围

python - PyQt - 如何将单独的 UI 小部件添加到 QMainWindow

php - 如果 php 文件超时,mysql 查询会发生什么情况?

mysql - 如何获得总小时数?

php - 使用 array_key_exists 将总金额与 id 配对