我目前正在下载 Flask -MySQLdb 作为初学者在登录系统项目上工作,但是当我尝试安装它时,它一直给我这个错误,我不知道如何解决它。
Collecting Flask-MySQLdb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Requirement already satisfied: Flask>=0.10 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Flask-MySQLdb) (1.1.2)
Collecting mysqlclient
Using cached mysqlclient-2.0.1.tar.gz (87 kB)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (1.1.0)
Requirement already satisfied: Werkzeug>=0.15 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (1.0.1)
Requirement already satisfied: click>=5.1 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (7.1.2)
Requirement already satisfied: Jinja2>=2.10.1 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (2.11.2)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\고명수\pycharmprojects\myeongsoopython\venv\lib\site-packages (from Jinja2>=2.10.1->Flask>=0.10->Flask-MySQLdb) (1.1.1)
Using legacy setup.py install for Flask-MySQLdb, since package 'wheel' is not installed.
Using legacy setup.py install for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient, Flask-MySQLdb
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\고명수\PycharmProjects\MyeongsooPython\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\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\고명수\AppData\Local\Temp\pip-record-_h_9brc2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\고명수\PycharmProjects\MyeongsooPython\venv\include\site\python3.8\mysqlclient'
cwd: C:\Users\고명수\AppData\Local\Temp\pycharm-packaging\mysqlclient\
Complete output (25 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
warning: build_py: byte-compiling is disabled, skipping.
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\고명수\PycharmProjects\MyeongsooPython\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\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\고명수\AppData\Local\Temp\pip-record-_h_9brc2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\고명수\PycharmProjects\MyeongsooPython\venv\include\site\python3.8\mysqlclient' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the 'C:\Users\고명수\PycharmProjects\MyeongsooPython\venv\Scripts\python.exe -m pip install --upgrade pip' command.
好吧,该消息建议将 pip 升级到最新版本,所以我尝试了它,但它再次给了我这个错误。