ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
在开发一个python项目是,需要用到mysql,但是,
安装完mysql-python后import加载模块提示以下错误:
ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
可以尝试一下两种方法:
方法一:
在mysql-python的安装目录下找到site.cfg,将
#mysql_config = XXXXXXXXXXXXXXXX
注释符号去掉,并填上mysql_config的地址
方法二:
将mysql/lib下所有关于libmysqlclient的so文件软链接到/usr/lib下。
>>> ln -s /usr/local/mysql/lib/libmysqlclient* /usr/lib
重新加载配置
>>> ldconfig
这时候就不会出错了
以上转自http://www .pythontab.com/html/2013/pythonhexinbiancheng_0816/542.html
以上方法一般是有效的。
特殊情况
由于我自己安装的是mysql5.6版本,所以在 /usr/local/mysql/lib/libmysqlclient*库都是libmysqlclient.so.18的。
linux下python是用的默认的2.7版本,他默认使用的libmysqlclient_r.so.16库,所以找不到libmysqlclient_r.so.16。
解决方法:
在/usr/lib64/mysql/下一般有自带的libmysqlclient.so.16的库
1、使用软连接到/usr/lib64/目录下。
>>>ln -s /usr/lib64/mysql/libmysqlclient* /usr/lib
2、设置libmysqlclient.so.16库的加载路径
在/etc/ld.so.conf文件中添加/usr/lib64/mysql路径 或者 在/etc/ld.so.conf.d/目录下添加一个*.conf配置文件,并在配置文件中添加/usr/lib64/mysql路径
ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory的更多相关文章
- 解决ImportError: libmysqlclient_r.so.16: cannot open shared object file-乾颐堂
在开发一个python项目是,需要用到mysql,但是, 安装完mysql-python后import加载模块提示以下错误: ImportError: libmysqlclient_r.so.16: ...
- 遇到了ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
解决方法如下: 1. 通过命令查找libmysqlclient_r.so.16 在什么地方,一般是在/usr/lib64/mysql/下面 2. 做一个链接到/usr/lib64 下: ln -s / ...
- libmysqlclient.so.16: cannot open shared object file: No such file or directory
编译安装的mysql5.6.39,安装目录是/usr/local/mysql,启用程序时报错:libmysqlclient.so.16: cannot open shared object file: ...
- ImportError: libsybdb.so.5: cannot open shared object file: No such file or directory pymssql linux 问题解决 搭建驱动
[root@hadoop1 nlp]# python sqlserver_t.py Traceback (most recent call last): File "sqlserver_t ...
- crontab,定时任务执行找不到库or shell可执行,crontab 定时任务下就不能执行,tensorflow,ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
在线上启动一个定时任务,但是起来查看,发现任务执行找不到库,报cuda错误: ImportError: libcuda.so.1: cannot open shared object file: No ...
- ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory
ubuntu16.04安装cuda8.0,tensorflow-gpu版本后,运行时报错: ImportError: libcudnn.so.5: cannot open shared object ...
- 关于ImportError: libssl.so.10: cannot open shared object file: No such file or directory unable to load app 0 (mountpoint='') (callable not found or import error)
一.问题描述 在亚马逊云服务器使用Nginx+uwsgi部署django项目时,项目可以使用python manage.py runserver正常运行,uwsgi测试也没问题,Nginx也正常启动, ...
- ImportError: liblapack.so.3: cannot open shared object file问题
问题: 安装完tensorflow后,在终端输入: python import cv2 出现如下错误: ImportError: liblapack.so.3: cannot open shared ...
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
Solution sudo apt-get install libsm6 Similarly ImportError: libXrender.so.1: cannot open shared obje ...
随机推荐
- EasyUI学习总结(六)——EasyUI布局
一.EasyUI布局介绍 easyUI布局容器包括东.西.南.北.中五个区域,其中中心面板是必须的,而东.西.南.北这四个面板是可选的,如果布局里面不需要东.西.南.北这四个面板,那么可以把相应的di ...
- ASIHTTPRequest 详解, http 请求终结者
转:http://www.cnblogs.com/chen1987lei/archive/2011/06/07/2074636.html ASIHTTPRequest是一款极其强劲的HTTP访问开源项 ...
- 从零开始优雅的使用mongodb实例
基本连接 一.创建express工程testmon express testmon 二.精简app.js var express = require("express"); var ...
- Servlet第五课:Cookie的使用
目标规划: 通过这一节课,我们能够懂得怎样使用Cookie.以及怎样获取Cookie中的内容. 插播广告:博客之星评选.点击投我一票.谢谢. Cookie的具体概述. 1. Cookie 是保存在cl ...
- Java HashSet工作原理及实现
1. 概述 This class implements the Set interface, backed by a hash table (actually a HashMap instance). ...
- Android 如何保持屏幕常亮
确认应用需要像游戏或者视频应用一样保持屏幕处于开启状态.最好的方式是在Activity中使用FLAG_KEEP_SCREEN_ON.(and only in an activity, never in ...
- MySQL 大致测试更新时间
1:需求:把一个2千万条数据的一个表,随机更新其中的二十行需要大致多久? DROP TABLE IF EXISTS test20; CREATE TABLE test20( id INT AUTO_I ...
- dubbo服务启动的方式
dubbo服务启动的方式: 1.dubbo自带的脚本, 2.直接用main方法启动dubbo的spring容器,参见dubbo-test里的各个例子 3.dubbo的spring boot start ...
- (原)pycharm中使用CUDA_VISIBLE_DEVICES
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/8576825.html 如果使用多gpu运行程序,可以直接使用CUDA_VISIBLE_DEVICES= ...
- selenium是如何启动浏览器的
前几天有同学问到selenium是怎么样启动浏览器的(selenium启动浏览器的原理),当时稍微讲解了一下,不过自我感觉不够具体,现在特地把启动原理通过代码和一系列操作给串联起来,希望可以帮助大家更 ...