installation error of mysql for django 1.8 - mysql

i'm trying to install mysql using pip and this error appears.
I'm new to python
the cmd says
"fatal error C1083: Cannot open include file: 'config-win.h: no such file or directory
error: command 'C:\\programfiles(x86)\\microsoft visual studio 10.0\\vc\\bin\\c1.exe'
failed to exit status 2"
if it is already solved i am sorry because i don't understand the presented solutions such as site.cfg that they say don't work anymore (i don't even understand it) my problem is also similar to this
I'm using python 3.4.3 and django 1.8.2

mysql-python is currently not supported by python 3
You have to install mysqlclient and PyMysql

Related

mysqlclient installtion error on python3.6 in venv in unix20.0

Link to open the issue image
When I tried to install mysqlclient using pip in unix inside virtualenv it showed me MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory. please help me with your suggestions. Thank you
had this exact error today. Turns out Python 3.10 hadn't been installed [it was downloaded and made, but sudo make install wasn't done]. Idk if you're active or if this is relevant since it's been a long time, but give it a shot.

Deploying Django project on pythonanywhere: Error running WSGI application

I have a mysql database for my django project. Had also installed XAMPP for local development. While deploying I did. I think there's a problem with the python version of my pthonanywhere bash console. My project can support only python 3.7 because of the kiteconnect module that I am using.
I have installed kiteconnect, mysqlclient, and mysql connector (checked it with pip3 freeze too)
pa_autoconfigure_django.py --python = 3.7 <git-repo-url>
I set up my database and made the changes suggested in my settings.py file in DATABASE, (changed hostname, database name, passowrd, PORT:3306, etc). I am getting this error in logs:
Error running WSGI application
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Please help me. This is a project I'm working on. Will be happy to provide further inputs too.
pa_autoconfigure_django creates a virtualenv using the requirements.txt file in your project. If you do not have mysqlclient in your requirements.txt file, then it will not be installed in the virtualenv.

mySQL legacy database with Django - error due to incorrect version of mysqlclient using XAMPP

I am getting the following error on trying to install mysqlclient. Note: Python version: Python 3.7.3
ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
I used the following stackoverflow q/a to help me, but got the above version error.
Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?'
The official Django docs are very sparse on their instructions and do not even mention the need to install mysql client. I also notice that there are various different suggestions.
I have two questions:
What is the best way to connect an existing/legacy mysql database to Django (what steps should I follow before being able to type the final command: python manage.py inspectdb
What is the best way to use an existing mysql database and use it with Django.
Note: I currently have XAMPP installed and hope to be able to connect to it on a local host from there.
Fix 1: I have tried a fix that involves installing a wheel, going to this website and downloading the version that seems to correspond best to my python version and 64 bit (https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient) but again get the following error:
C:\Users\USERNAME\Desktop\djangottio\djangottio>pip install mysqlclient-1.4.2-cp37-cp37m-win_amd64.whl
RESULTANT ERROR from Fix 1:
mysqlclient-1.4.2-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
I have solved fix 1's error (see above) by using this very helpful post: https://stackoverflow.com/a/36158157/5074035
But....on trying the python manage.py inspectdb command it still comes up with the error:
ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required;

Installing MySQLDB for python 2.7 using pip on Windows 7 64bit

I have spent hours trying multiple approaches to install MYSQLDB module for python, and no success.
My python version: 2.7.6
Django - 1.10.3
OS: Windows 7 64-bit
MySQL connector - MySQL Connector C 6.0.2
Currently I have an error in my project, namely:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
I have tried to install mysqldb running the following command:
pip install mysql-python
It ran successfully, but the error still persisted. Then I tried to run
pip install MySQL-python
and I am getting Cannot open include file config-win.h.
I came across this post, but I don't understand the idea of the answer, specifically, I can't figure out where I should look for the mentioned files site.cfg and setup_windows.py. There are no such files in C:\Program Files\MySQL\MySQL Connector C 6.0.2\include
Finally, I tried to install MySQLDb using wheels running
pip install mysqlclient-1.3.9-cp27-cp27m-win_amd64.whl command, I end up with
mysqlclient-1.3.9-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform error.
I have lost my hope. Help please !!!
Try to install 32 bit version mysqlclient-1.3.9-cp27-cp27m-win32.whl
If it doesn't work try to install it from (where you can find compiled windows libraries):
http://www.lfd.uci.edu/~gohlke/pythonlibs/

ImportError: No module named 'MySQLdb' - django + mysql

This question concerns: django 1.5.1 with python 3.3 and mysql 5.6.12
Wanting to get Mysql running with Django. Had everything configured, even Database exists with user-pemissions. Got some error when trying syncdb:
ImportError: No module named 'MySQLdb'
There is obviously the Mysql-Lib for python missing. Downloaded the master-edition from petehunt/PyMySQL. Tried "python setup.py install" . Says:
ImportError: No module named 'constants'
Downloaded another version. A tarball from here. Run "python setup.py install". Seems to work, tried to run the syncdb command "python manage.py syncdb". Still:
ImportError: No module named 'MySQLdb'
Any suggestions what to do now? Thanks in advance.
mysqlclient is the recommended mysql driver for python 3
You can install it via pip:
pip install mysqlclient
Well I solve it. Downgraded to 2.7.x , so that i could use this. Seems to me there should exist a big red warning for using django with python 3.x and Windows 7.