mysqlclient报错

来源:2-1 设计数据库模型并创建表

慕莱坞5224394

2021-05-02 16:54:31

ERROR: Command errored out with exit status 1:

   command: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-wheel-tc5a62gs'

       cwd: C:\Users\JIATEN~1\AppData\Local\Temp\pip-install-we9phtm6\mysqlclient_79864224cca444bdaa87d5975890a8b6\

  Complete output (25 lines):

  running bdist_wheel

  running build

  running build_py

  creating build

  creating build\lib.win32-3.6

  creating build\lib.win32-3.6\MySQLdb

  copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\_exceptions.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb

  copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb

  creating build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants

  copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants

  warning: build_py: byte-compiling is disabled, skipping.


  running build_ext

  building 'MySQLdb._mysql' extension

  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

  ----------------------------------------

  ERROR: Failed building wheel for mysqlclient

    ERROR: Command errored out with exit status 1:

     command: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-record-g54135n_\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\include\site\python3.6\mysqlclient'

         cwd: C:\Users\JIATEN~1\AppData\Local\Temp\pip-install-we9phtm6\mysqlclient_79864224cca444bdaa87d5975890a8b6\

    Complete output (25 lines):

    running install

    running build

    running build_py

    creating build

    creating build\lib.win32-3.6

    creating build\lib.win32-3.6\MySQLdb

    copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\_exceptions.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb

    copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb

    creating build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants

    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants

    warning: build_py: byte-compiling is disabled, skipping.


    running build_ext

    building 'MySQLdb._mysql' extension

    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

    ----------------------------------------

ERROR: Command errored out with exit status 1: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-record-g54135n_\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\include\site\python3.6\mysqlclient' Check the logs for full command output.


写回答

1回答

时间,

2021-05-03

同学,你好!使用pip命令安装mysqlclient大多数情况下是会报错的,同学可尝试以下安装方法:

1、先查看一下电脑中的Python版本,然后下载对应版本的mysqlclient,链接:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient


http://img.mukewang.com/climg/608f6a9209bda39111680764.jpg

2、进入到下载目录,执行命令pip install mysqlclient-xxx.whl进行安装

祝:学习愉快!

0

0 学习 · 3562 问题

查看课程