首页  /  后端技术  /  Python  /  python安装mysqlclient出现报错

python安装mysqlclient出现报错

 作者:白驹    来源:原创    浏览:192    日期:2020年5月5日  

python安装mysqlclient出现报错

运行pip install mysqlclient出现如下报错!
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
    Complete output from command E:\pyproject\blog\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\yan\\AppData\\Local\\Temp\\pip-install-tlhqzbpi\\mysqlclient\\setup.py';f=getat
tr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\yan\AppData\Local\Temp\pip-record-fom6uk8p\install-record.txt
--single-version-externally-managed --compile --install-headers E:\pyproject\blog\venv\include\site\python3.5\mysqlclient:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.5
    creating build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\compat.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
    copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
    creating build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\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/

    ----------------------------------------
Command "E:\pyproject\blog\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\yan\\AppData\\Local\\Temp\\pip-install-tlhqzbpi\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', ope
n)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\yan\AppData\Local\Temp\pip-record-fom6uk8p\install-record.txt --single-version-externa
lly-managed --compile --install-headers E:\pyproject\blog\venv\include\site\python3.5\mysqlclient" failed with error code 1 in C:\Users\yan\AppData\Local\Temp\pip-install-tlhqzbpi\mysqlclient\
点击链接:https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/cp35/mysqlclient-1.4.6-cp35-cp35m-win_amd64.whl 下载mysqlclient-1.4.6-cp35-cp35m-win_amd64.whl文件
把下载好的文件移动到项目目录下,我这里安装了虚拟环境,直接安装,运行pip install mysqlclient-1.4.6-cp35-cp35m-win_amd64.whl
mysqlclient安装完成
  • 评论
  • 相关评论