Script Kitty
Script Kitty

Reputation: 1747

Python Django installing mysql: easy_install and pip errors

Trying to python manage.py syncdb but it gives me an error. Similar to a lot of other questions on here, but the solutions provided do not solve the error after I install them.

My settings.py file inside my project directory

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'network',
        'USER': 'root',
        'PASSWORD': 'mypass',
        'HOST': '', #EMPTY FOR LOCALHOST
        'PORT': '3307', #Empty by default
    }
}

I am using Windows 7, Python 3.4 (I heard was not compatible with install MySQL-python so instead I downloaded mysqlclient 1.3.6).

When I ran easy_install mysql-python it results in

_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe'
failed with exit status 2

Similarly it asks for config-win.h when running pip install mysql-python, along with a scary error

Command "D:\Users\Python\python.EXE -c "import setuptools, tokenize;__file__='C:\\Users\\AppData\\Local\\T
emp\\pip-build-w7q9kjxi\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('
\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\AppData\Local\Temp\pip-u982sugf-record\install-record.t
xt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\AppData\Local\Temp\pip-build
-w7q9kjxi\mysql-python

I'm pretty confused about this. The tutorial I've been looking at strays from me here, and I have no idea what to do with a WHL of mysqlclient.

Things I've tried already:

Please help with this beginner question, thanks for your time, if more info is needed I'd be happy to provide.

Upvotes: 0

Views: 2302

Answers (2)

Lorena Xiomara
Lorena Xiomara

Reputation: 1

I had the same error working on Windows, I solved it by downloading apart and then copying theMySQL_python-1.2.5-py2.7.egg-info and the MySQLdb folders and the _mysql.pyd and _mysql_exceptions.py files in C:\Users\%The-path-of-your-project%\Lib\site-packages

Upvotes: 0

user554538
user554538

Reputation:

Without Visual Studio, you'll need a binary installer for the right Python version and architecture. The easiest is probably to get both 32- and 64- bit packages for the installed Python version and install them both.

Upvotes: 3

Related Questions