简体   繁体   中英

python can't install mysql library

I want to connect to mysql database from python

I tried to do this: pip install mysql-python as this question suggested No module named MySQLdb

but I got this exception

Cleaning up...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use
rs\\user\\appdata\\local\\temp\\pip_build_User\\mysql-python\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-kkagjy-re
cord\install-record.txt --single-version-externally-managed --compile failed wit
h error code 1 in c:\users\user\appdata\local\temp\pip_build_User\mysql-python
Storing debug log for failure in C:\Users\User\pip\pip.log

In my python code, I keep getting this error

No module named MySQLdb

I am using windows 7

I found the solution myself

http://www.codegood.com/archives/129

download that and it is enough

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM