解决python3.8安装mysqlclient失败的问题

PIP在线安装失败

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?

(venv) D:\djangoall\education\edu>pip install wheel
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.34.2

(venv) D:\djangoall\education\edu>pip install mysqlclient-1.4.6-cp38-cp38-win_amd64.whl
mysqlclient-1.4.6-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

https://www.lfd.uci.edu/~gohlke/pythonlibs/#entropy
下载对应版本的whl文件,本地安装还是失败
怎么办?
进入python环境下

>>> import pip._internal;
>>> print(pip._internal.pep425tags.get_supported())
[('cp38', 'cp38m', 'win_amd64'), ('cp38', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp38', 'none', 'any'), ('cp3', 'none', 'any'), ('py38', 'none', 'any'), ('py3', 'none', 'any'), ('py37', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any
'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
>>>

问题就出现在cp38m这里,下载的whl文件是cp38,果断改 cp38m

(venv) D:\djangoall\education\edu>pip install mysqlclient-1.4.6-cp38-cp38m-win_amd64.whl
Processing d:\djangoall\education\edu\mysqlclient-1.4.6-cp38-cp38m-win_amd64.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.6

安装成功!
如果这个心得帮到了你解决了这个问题,来个赞~:)共勉!

你可能感兴趣的:(Python,Django,python,mysql)