django - 为 windows 安装 mysqlclient 时出错
问题描述
我很想pip install mysqlclient
通过命令提示符在 Windows 上使用 python 安装 mysqlclient。但是会引发这样的错误
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'h:\python3.7.2\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\varun\\AppData\\Local\\Temp\\pip-install-x8dma35a\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\varun\\AppData\\Local\\Temp\\pip-install-x8dma35a\\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\varun\AppData\Local\Temp\pip-record-iljjp945\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\varun\AppData\Local\Temp\pip-install-x8dma35a\mysqlclient\
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'h:\python3.7.2\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\varun\\AppData\\Local\\Temp\\pip-install-x8dma35a\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\varun\\AppData\\Local\\Temp\\pip-install-x8dma35a\\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\varun\AppData\Local\Temp\pip-record-iljjp945\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
谁能帮我清除这个错误。提前致谢。
解决方案
推荐阅读
- struct - Swift UI,从数组中删除项目,同时在其中循环抛出致命错误:索引超出范围
- python - Matplotlib 在 pycharm 中导致运行时错误
- javascript - 在 React 中使用 fluent-ui 构建仪表板,卡片和表格不应该出现在屏幕底部
- php - 循环数组并将值存储在表中
- python - 在 python 烧瓶中使用 CSS
- gams-math - 将系统日期和时间作为字符串写入 gdx
- docker - docker spark集群上容器之间的spark app socket通信
- r - 是否可以在 R 的列名中创建包含空格的数据框?
- security - 我们在 Google Cloud 中是否有类似 AWS 命名配置文件的功能?
- java - Java:有没有办法,如何导入与 .jar 位于同一文件夹中的文件?