Question

I have a shared hosting environment on Bluehost. I am running a custom installation of python(+ django) with a few installed modules. All has been working, until yesterday a change was made on the server(I assume) which gave me this django error:

... File "/****/****/.local/lib/python/django/utils/importlib.py", line 35, in import_module
    __import__(name)

File "/****/****/.local/lib/python/django/db/backends/mysql/base.py", line 14, in 
    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

Of course, Bluehost support is not too helpful. They advised that 1) I use the default python install, because that has MySQLdb installed already. Or that 2) I somehow import the MySQLdb package installed on the default python, from my python(dont know if this can even be done). I am concerned that if I use the default install I wont have permission to install my other packages.

Does anybody have any ideas how to get back to a working state, with as little infrastructure changes as possible?

Was it helpful?

Solution

I think you upgraded your OS installation which in turn upgraded libmysqlclient and broke native extension. What you can do is reinstall libmysqlclient16 again (how to do it depends your particular OS) and that should fix your issue.

Other approach would be to uninstall MySQLdb module and reinstall it again, forcing python to compile it against a newer library.

OTHER TIPS

You were right. Bluehost upgraded MySQL. Here is what I did: 1) remove the "build" directory in the "MySQL-python-1.2.3" directory 2) remove the egg 3) build the module again "python setup.py build" 4) install the module again "python setup.py install --prefix=$HOME/.local"

Morale of the story for me is to remove the old stuff when reinstalling module

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top