4
usually when you get these kinds of errors, you are missing development packages โ you need to install the header files as they donโt come with mysqldb.
iโve not done this on apple personally, but hereโs a link to their article on how to go about such a thing.
http://support.apple.com/kb/ht4006
after youโve installed the source, mysqldb should be able to compile and install without issues.
51
you can add manually the header file into mysql include directory (download from github repo):
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
Retry pip install
sudo pip install MySQL-python
- [Django]-How can I make a Django form field contain only alphanumeric characters
- [Django]-Django render_to_string missing information
- [Django]-Raw_id_fields: How to show a name instead of id?
32
If ubuntu : apt-get install mysql-devel
If centos/rhel : yum install mysql-devel
Then install MySQL-python
- [Django]-Multiple many-to-many relations to the same model in Django
- [Django]-Multiple annotate Sum terms yields inflated answer
- [Django]-Django: Multiple url patterns starting at the root spread across files
17
As found here you need to copy my_config.h to /usr/include/mysql
, then pip install MySQL-python
.
- [Django]-How to implement breadcrumbs in a Django template?
- [Django]-Django app works fine, but getting a TEMPLATE_* warning message
- [Django]-Django.db.utils.OperationalError: fe_sendauth: no password supplied
1
i have just get this problem. i tried use the
VCForPython27.msi
to solve it. but it doesnโt work..
i find the answer in the Github: PyMySQL/mysqlclient-python,
NOTE: Wheels for Windows may be not released with source package. You should pin version in your requirements.txt to avoid trying to install newest source package.
so, the answer is that: assign the version of mysqlclient, use pip install mysqlclient==1.x.x insdead of
- [Django]-Django Unit Testing taking a very long time to create test database
- [Django]-Why don't my south migrations work?
- [Django]-Django-admin: Add extra row with totals
0
I had a similar issue and fixed it with:
brew install mysql-client
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
pip install MySQL-python
- [Django]-A QuerySet by aggregate field value
- [Django]-Related Field got invalid lookup: icontains
- [Django]-Django: accessing the model instance from within ModelAdmin?
0
Please check these:
1)libmysqlclient-dev
is installed
2)my_config.h
is in /usr/include/mysql
If not present find it here:
https://dev.mysql.com/doc/dev/mysql-server/8.0.11/my__config_8h_source.html )
- [Django]-In the Django admin site, how do I change the display format of time fields?
- [Django]-Best way to get query string from a URL in python?
- [Django]-Machine Learning (tensorflow / sklearn) in Django?
0
Install using deb package from https://packages.debian.org/buster/python-mysqldb
Dependencies are apt install libmariadb3 mariadb-common
for the above package.
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-Gunicorn autoreload on source change
- [Django]-How to apply multiple filters on a Django template variable?