29👍
Clearly installing pip install MySQL-python
is the way to go. The problem is with the location of mysql_config. Look around here, this might help you depending on your OS: mysql_config not found when installing mysqldb python interface
Edit:
In case the install script fails with Command "python setup.py egg_info" failed with error code 1 in {...}
, installing libmysqlclient-dev with
sudo apt install libmysqlclient-dev
should fix the issue. Thanks to @thirupathi-thangavel.
3👍
If the above method not working then try
mysqlclient
pip install mysqlclient
I did not found the above library using python version(3.9) and I installed the mysqlclient and it worked for fine.
- Issues with queryset and slicing
- Does Django use processes or threads to handle user requests in view?
- ALLOWED_HOSTS and Django
- How to get coordinates of address from Python
- Creating an entire web application using django admin
1👍
brew install mysql
Path will be shown after installation is complete, use that in below command :
sudo PATH=/usr/local/Cellar/mysql/bin/:$PATH pip install mysql-python
- Django 'resolve' : get the url name instead of the view_function
- How to limit number of records in Django Rest Framework reverse relations
- How to export Django model data into CSV file
- Get_readonly_fields in a TabularInline class in Django?
- Django Can't Find My Templates
0👍
I followed my question here 404 error when using brew to install mysql
and then as fodma1 suggested went to here stackoverflow.com/a/33928783/2419215
and now it works for the most part (have another error but thats for another post)!
Thanks EdBaker and fodma1!
- Using django models across apps?
- How to remove these '"' in django template
- Django heroku static dir
- Django User model email field: how to make it mandatory