Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

python - Building wheel for mysqlclient (setup.py) ... error

I am trying to install mysqlclient by runing pip install mysqlclient on my shell, and it says the following error:

Collecting mysqlclient
  Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'g:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"'; __file__='"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersUserAppDataLocalTemppip-wheel-_7zysw22'
       cwd: C:UsersUserAppDataLocalTemppip-install-rhaf8m0zmysqlclient_21d1d7a0b8c4431382bfeeefc437906d
  Complete output (23 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win32-3.8
  creating buildlib.win32-3.8MySQLdb
  copying MySQLdb\__init__.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdb\_exceptions.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdbconnections.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdbconverters.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdbcursors.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdb
elease.py -> buildlib.win32-3.8MySQLdb
  copying MySQLdbimes.py -> buildlib.win32-3.8MySQLdb
  creating buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstants\__init__.py -> buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstantsCLIENT.py -> buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstantsCR.py -> buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstantsER.py -> buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstantsFIELD_TYPE.py -> buildlib.win32-3.8MySQLdbconstants
  copying MySQLdbconstantsFLAG.py -> buildlib.win32-3.8MySQLdbconstants
  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
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: 'g:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"'; __file__='"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UserythonIncludemysqlclient'
         cwd: C:UsersUserAppDataLocalTemppip-install-rhaf8m0zmysqlclient_21d1d7a0b8c4431382bfeeefc437906d
    Complete output (23 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win32-3.8
    creating buildlib.win32-3.8MySQLdb
    copying MySQLdb\__init__.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdb\_exceptions.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdbconnections.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdbconverters.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdbcursors.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdb
elease.py -> buildlib.win32-3.8MySQLdb
    copying MySQLdbimes.py -> buildlib.win32-3.8MySQLdb
    creating buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstants\__init__.py -> buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstantsCLIENT.py -> buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstantsCR.py -> buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstantsER.py -> buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstantsFIELD_TYPE.py -> buildlib.win32-3.8MySQLdbconstants
    copying MySQLdbconstantsFLAG.py -> buildlib.win32-3.8MySQLdbconstants
    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: 'g:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"'; __file__='"'"'C:\Users\User\AppData\Local\Temp\pip-install-rhaf8m0z\mysqlclient_21d1d7a0b8c4431382bfeeefc437906d\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersUserAppDataLocalTemppip-record-l20p5rkoinstall-record.txt' --single-version-externally-managed 
--compile --install-headers 'g:pythonIncludemysqlclient' Check the logs for full command output.

I am using python version 3.8.3 and no mysql software is installed on my pc, just xampp is installed.

Please suggest, how can I fix it?

question from:https://stackoverflow.com/questions/66068888/building-wheel-for-mysqlclient-setup-py-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...