pip install时报错
Posted afei123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip install时报错相关的知识,希望对你有一定的参考价值。
因为需要mysqlclient这个模块,但是在pip的时候报错
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Complete output from command ‘c:\users\libo3\appdata\local\programs\python\python37-32\python.exe‘ -u -c ‘import setuptools, tokenize;__file__=‘"‘"‘C:\\Users\\libo3\\AppData\\Local\\Temp\\pip-install-dx_ukroi\\mysqlclient\\setup.py‘"‘"‘;f=getattr(tokenize, ‘"‘"‘open‘"‘"‘, open)(__file__);code=f.read().replace(‘"‘"‘\r\n‘"‘"‘, ‘"‘"‘\n‘"‘"‘);f.close();exec(compile(code, __file__, ‘"‘"‘exec‘"‘"‘))‘ bdist_wheel -d ‘C:\Users\libo3\AppData\Local\Temp\pip-wheel-rh1vf72j‘ --python-tag cp37:
ERROR: running bdist_wheel
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: 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: Complete output from command ‘c:\users\libo3\appdata\local\programs\python\python37-32\python.exe‘ -u -c ‘import setuptools, tokenize;__file__=‘"‘"‘C:\\Users\\libo3\\AppData\\Local\\Temp\\pip-install-dx_ukroi\\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\libo3\AppData\Local\Temp\pip-record-etl1tmtl\install-record.txt‘ --single-version-externally-managed --compile:
ERROR: 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 "‘c:\users\libo3\appdata\local\programs\python\python37-32\python.exe‘ -u -c ‘import setuptools, tokenize;__file__=‘"‘"‘C:\\Users\\libo3\\AppData\\Local\\Temp\\pip-install-dx_ukroi\\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\libo3\AppData\Local\Temp\pip-record-etl1tmtl\install-record.txt‘ --single-version-externally-managed --compile" failed with error code 1 in C:\Users\libo3\AppData\Local\Temp\pip-install-dx_ukroi\mysqlclient\
如此一长串的错误,看的我头皮发麻,最后在网上看到别人也有类似错误,就Mark一下
首先先去这个网站https://www.lfd.uci.edu/~gohlke/pythonlibs/,找到要下的东西对应的版本,然后再cmd里打开下载的目录,pip install 你下载的文件就OK了
以上是关于pip install时报错的主要内容,如果未能解决你的问题,请参考以下文章
pip install Wikipedia2Vec时报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in
DjangoMac 安装pip3-install-mysqlclient 报错