我正在使用PyCharm,并且试图制作一个连接数据库的简单脚本。
在PyCharm终端中,来自here的两个mysqlclient安装似乎都失败了。
(venv) C:\Users\erics\CS261>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.
(venv) C:\Users\erics\CS261>pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
mysqlclient-1.4.6-cp38-cp38-win32.whl is not a supported wheel on this platform.
在Windows终端中,它们已成功安装:
C:\Users\erics>pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
Processing c:\users\erics\mysqlclient-1.4.6-cp38-cp38-win32.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.6
即使已“成功安装”,我的脚本似乎也无法运行...
C:\Users\erics\CS261\venv\Scripts\python.exe C:/Users/erics/CS261/venv/Scripts/test.py
Traceback (most recent call last):
File "C:/Users/erics/CS261/venv/Scripts/test.py", line 1, in <module>
import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
Process finished with exit code 1