在Windows 10中安装mysqlclient for python时出错

2024-10-04 09:26:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我用这个命令安装MySQL客户端: pip install mysqlclient

然后我看到了这个问题:

running build_ext

building '_mysql' extension

error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279


Cleaning up... Command C:\Python34\python.exe -c "import setuptools, tokenize;file='C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\Jayed\AppData\Local\Temp\pip-l4c6dhkk-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient Storing debug log for failure in C:\Users\Jayed\pip\pip.log


Tags: installpipbuildlocalwitherrorrecordusers
1条回答
网友
1楼 · 发布于 2024-10-04 09:26:52

实际上我是沿着这条路走的。虽然我认为您可以找到让客户端编译所需的所有库和组件,但它告诉您它找不到客户端的编译副本,并试图编译它以安装它。
按照下面的说明操作:https://pypi.org/project/mysqlclient/(它有关于windows执行您所描述的操作的注释)或下载控制盘文件(从页面上的下载链接)并键入

pip安装mysqlclient.whl在

它将不需要C++安装,以便使用Python使用MySQL。在

相关问题 更多 >