由于使用pip安装MySQL-python
,可能导致的问题是本地python是64bit,pip安装的MySQL-python是32bit。下载地址:
报错如下:
-
C:\Users\SongHyun>python
-
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (
-
AMD64)] on win32
-
Type "help", "copyright", "credits" or "license" for more information.
-
>>> import MySQLdb
-
Traceback (most recent call last):
-
File "", line 1, in <module>
-
File "D:\python2.7.11\lib\site-packages\MySQLdb\__init__.py", line 19, in <mod
-
ule>
-
import _mysql
-
ImportError: No module named _mysql
-
-
-
C:\Users\SongHyun>python
-
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (
-
AMD64)] on win32
-
Type "help", "copyright", "credits" or "license" for more information.
-
>>> import MySQLdb
-
>>>
阅读(1029) | 评论(0) | 转发(0) |