MySQLdb ImportError: libmysqlclient.so.18解决方法
2014-08-21 00:00
891 查看
安装MySQLdb后,import MySQLdb出错如下:
根据最后提示,应该是找不着一个交libmysqlclient.so.18的文件,于是到mysql安装目录里找到这个文件并且做一个软连接到/usr/lib
如果是64系统则:
再次import MySQLdb就正常了:
[root@lizhong MySQL-python-1.2.3]# /usr/local/bin/python2.7 Python 2.7.6 (default, Apr 10 2014, 15:45:39) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/_mysql.pyc, but /soft/MySQL-python-1.2.3 is being added to sys.path Traceback (most recent call last): File "<stdin>", line 1, in <module> File "MySQLdb/__init__.py", line 19, in <module> import _mysql File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in <module> File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in __bootstrap__ ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory
根据最后提示,应该是找不着一个交libmysqlclient.so.18的文件,于是到mysql安装目录里找到这个文件并且做一个软连接到/usr/lib
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18
如果是64系统则:
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
再次import MySQLdb就正常了:
[root@lizhong MySQL-python-1.2.3]# /usr/local/bin/python2.7 Python 2.7.6 (default, Apr 10 2014, 15:45:39) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb >>>
相关文章推荐
- MySQLdb ImportError: libmysqlclient.so.18解决方法
- MySQLdb ImportError: libmysqlclient.so.18解决方法
- error while loading shared libraries: libmysqlclient.so.18解决方法
- 重启Zabbix服务提示缺少libmysqlclient.so.18解决方法
- error while loading shared libraries: libmysqlclient.so.16/18: cannot open shared object file
- 关于安装php时的libmysqlclient.so.18错误Error 127
- error while loading shared libraries: libmysqlclient.so.16/18: cannot open shared object file
- 编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
- 编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
- Hue 安装问题django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so
- PHP编译报错configure: error: Cannot find libmysqlclient under 解决方法
- 报错:/application/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
- /lib/libmysqlcppconn.so: undefined reference to `mysql_stmt_execute@libmysqlclient_18' 解决方法
- 编译C连接MySQL 提示 error while loading shared libraries: libmysqlclient.so.
- error while loading shared libraries: libcudart.so.7.5: cannot open shared ......解决方法
- MySQLDB install Error:libmysqlclient_r.so.16: cannot open shared object
- error while loading shared libraries: libcudart.so.7.5: cannot open shared ......解决方法
- Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
- 关于/libexec/ld-elf.so.1: Shared object "libmysqlclient.so.15" not foun cc36 d问题的解决
- mysql: error while loading shared libraries: libmysqlclient.so.16