19👍
reinstall the c shared library:
pip uninstall mysql-python
pip install mysql-python
18👍
My issue with the same error message was mysql environment not all the way set up. I needed to uninstall MySQL-python; install libmysqlclient-dev; reinstall MySQL-python to rectify the issue.
So the fix was too:
- sudo pip uninstall MySQL-python (uninstall from your package manager of choice)
-
sudo apt-get install libmysqlclient-dev
-
sudo pip install MySQL-python
**I should also mention that I used the –no-cache-dir option with pip install to hit PYPI directly which helped discover the following:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-Y7RFpJ/mysql-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-Y7RFpJ/mysql-python/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-Y7RFpJ/mysql-python/setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
and lead me to here
Using: mysql 5.7, mysql-python 1.2.5, django 1.8.9, ubuntu 16.04
- AttributeError: 'NoneType' object has no attribute 'attname' (Django)
- Django render_to_string() ignores {% csrf_token %}
- Remove padding from matplotlib plotting
2👍
Use the following commands:
pip uninstall mysql-python
pip install mysql-python
In my case it work because it searches from the complied files.
- Change default Django REST Framework home page title
- Is there a way to render a html page without view model?
- Select Children of an Object With ForeignKey in Django?
- Can't login to Django /admin interface
2👍
I did fix the same issue via setting below environment variable:
export LD_LIBRARY_PATH=/usr/local/mysql/lib
- Django, Security and Settings
- What is the right way to use angular2 http requests with Django CSRF protection?
- What does it mean for an object to be unscriptable?
2👍
In my case the problem was caused by Ubuntu upgrades, so I can’t find libmysqlclient.so.20
in /usr/lib/x86_64-linux-gnu
.
Solution:
- Check existance
libmysqlclient.so.XX
in/usr/lib/x86_64-linux-gnu
(or similar) - Download
libmysqlclient.so.XX
from Ubuntu website (eg. link for v20) - Install lib using dpkg command
sudo dpkg -i libmysqlclient(...).deb
andsudo apt-get install -f
- Link lib:
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.XX.so libmysqlclient.XX.so
1👍
I had the same problem and I fixed making what the mysqlclient official doc says to install before:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
- Remove padding from matplotlib plotting
- Celery – No module named five
- Converting a django ValuesQuerySet to a json object
0👍
just in case pip uninstall
& pip install
not working, and you dont want to set specific path to ld_library_path
, what I did on my vps:
cd /usr/local/lib
sudo ln -s /path/to/your/libmysqlclient.so.20
in my case my mysql is installed from linuxbrew (there is some reason to install inside home), so I had to navigate there $HOME/.linuxbrew/Cellar/mysql/5.7.18/lib/libmysqlclient.so.20
- Installing django 1.5(development version) in virtualenv
- Django template tag: How to send next_page in {url auth_logout}?