python - 定位 libmysqlclient_r.so.16 issue

标签 python django linux mysql-python

首先我想告诉大家我是新手,我的网页设计师不在国外。我有以下问题并正在寻找一些建议。我已经重新安装了 mysqldb 并升级了软件包。我和我的托管公司谈过,他们建议他们升级到 mysql 5.5。

我搜索了网络和 stackoverflow,并尝试了上面提到的许多不同的解决方案。

这是来自服务器错误日志的错误:

    [Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr: Traceback (most recent call last):
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home1/elitejdm/python/lib/python2.5/site-packages/flup-1.0.3.dev_20110405-py2.5.egg/flup/server/fcgi_base.py", line 574, in run
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     protocolStatus, appStatus = self.server.handler(self)
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home1/elitejdm/python/lib/python2.5/site-packages/flup-1.0.3.dev_20110405-py2.5.egg/flup/server/fcgi_base.py", line 1159, in handler
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     result = self.application(environ, start_response)
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 194, in __call__
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     self.load_middleware()
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/core/handlers/base.py", line 38, in load_middleware
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     mod = __import__(mw_module, {}, {}, [''])
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/middleware.py", line 1, in 
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     from django.contrib.flatpages.views import flatpage
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/views.py", line 1, in 
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     from django.contrib.flatpages.models import FlatPage
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/models.py", line 2, in 
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     from django.db import models
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/db/__init__.py", line 17, in 
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     backend = __import__('%s%s.base' % (_import_path, settings.DATABASE_ENGINE), {}, {}, [''])
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:   File "/home/elitejdm/python/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 12, in 
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr:     raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
[Wed Dec 05 12:12:47 2012] [warn] [client 146.145.36.41] mod_fcgid: stderr: ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory

这里又是同样的错误,但是通过 python:

python jdm_cars.fcgi

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
/home1/elitejdm/python/lib/python2.5/site-packages/MySQL_python_embedded-1.2.3-py2.5-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /home1/elitejdm/python/lib/python2.5/site-packages/MySQL_python_embedded-1.2.3-py2.5-linux-x86_64.egg/_mysql.py, but /home1/elitejdm/public_html/new_elitejdm/MySQL-python-1.2.3 is being added to sys.path
  import sys, pkg_resources, imp
Traceback (most recent call last):
  File "/home1/elitejdm/python/lib/python2.5/site-packages/flup-1.0.3.dev_20110405-py2.5.egg/flup/server/fcgi_base.py", line 574, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/home1/elitejdm/python/lib/python2.5/site-packages/flup-1.0.3.dev_20110405-py2.5.egg/flup/server/fcgi_base.py", line 1159, in handler
    result = self.application(environ, start_response)
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 194, in __call__
    self.load_middleware()
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/core/handlers/base.py", line 38, in load_middleware
    mod = __import__(mw_module, {}, {}, [''])
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/middleware.py", line 1, in <module>
    from django.contrib.flatpages.views import flatpage
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/views.py", line 1, in <module>
    from django.contrib.flatpages.models import FlatPage
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/contrib/flatpages/models.py", line 2, in <module>
    from django.db import models
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/db/__init__.py", line 17, in <module>
    backend = __import__('%s%s.base' % (_import_path, settings.DATABASE_ENGINE), {}, {}, [''])
  File "/home/elitejdm/python/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 12, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
Status: 500 Internal Server Error
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>Unhandled Exception</title>
</head><body>
<h1>Unhandled Exception</h1>
<p>An unhandled exception was thrown by the application.</p>
</body></html>

在写这篇文章时,我从我的托管公司那里找到了更多信息,我被告知以下内容

基本上我们将 libmysqlclient 更新为: libmysqlclient_r.so.18

来自: libmysqlclient_r.so.16

Due to being in a shared hosting environment, we have to make these updates from time to time. It appears this is what is causing you grief/issue.

You'll either A need to reinstall libmysqlclient_r.so.16 locally on your server without root access. (without yum)

OR B configure your script to handle the new .18 version.

If you do the first way, you won't need to update it in the future. If you do it the second way and we decide to update again. It will require you to update your scripts again

对此很陌生,所以我不知道该怎么做,但愿意学习...请提供任何帮助,我们将不胜感激。

最佳答案

Python module issue

请查看此线程中的第二个答案。解决了我的问题。

关于python - 定位 libmysqlclient_r.so.16 issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13732864/

相关文章:

python - Django - REMOTE_HOST 空答案

linux - 递归查找Linux中二进制目录的大小

linux - Bash 表达式错误

python - 在哪里可以找到社交网络风格功能/组件的 Python 代码示例或教程?

php - 从 Php 执行 Python 脚本

c++ - 如何在 C++ 服务器应用程序和 Django Web 应用程序之间进行通信

python - 在模板中显示时缩小图像尺寸

node.js - 错误消息 npm-default 不可用

python - 如何执行 python 脚本并将输出写入文件?

python - 将多列从行旋转到列