直接使用pip install MySQL-python,报了下面的错:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb.
Did you install mysqlclient or MySQL-python?
发现原来是pip 无法识别系统是多少位的(win果然不怎么爽)
后来下载了
- MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl
-
- pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl
- MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.
- 安装wheel:pip instal
继续安装:
pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl
MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.
还有错,真的是问题一大堆啊(主要还是不了解),后来发现原来我的python装的是32位的,喷血(电脑是64位的)
好吧,再去下载一个32位的MySQL-python
pip install MySQL_python-1.2.5-cp27-none-win32.whl
Processing c:\users\luzhiwei\downloads\mysql_python-1.2.5-cp27-none-win32.whl
Installing collected packages: MySQL-python
Successfully installed MySQL-python-1.2.5
好了,终于安装好了。