gpt4 book ai didi

python - 我无法安装 mysqlclient

转载 作者:行者123 更新时间:2023-12-03 18:49:44 25 4
gpt4 key购买 nike

 pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Using legacy setup.py install for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient'
cwd: C:\Users\Blackknight\AppData\Local\Temp\pip-install-85jgwelt\mysqlclient\
Complete output (23 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe -m pip install --upgrade pip' command.

最佳答案

您需要安装 Visual C++ 构建工具。你可以下载它们Here .然后尝试安装 mysqlclient再次。
或者
第二个选项 你也可以二进制安装它。

pip install --only-binary :all: mysqlclient
可选 :
最好升级您的 pip 运行 pip install --upgrade pip

关于python - 我无法安装 mysqlclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67147253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com