我已在 Windows 10 上安装了PyCharm的最新版本,以便在我的python项目中进行开发。但是我无法从python pypi libary安装任何软件包。
当我尝试安装软件包(任何软件包,而不仅仅是mysql)时,它由于以下错误而崩溃:
error: command 'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe'
failed with exit status 2
我重新安装了Visual Studio 17的构建工具(构建工具14),并且还安装了Visual Studio中任何给定的SDK或功能。但是仍然是同样的问题。
在Python 3.6和Python 3.7上运行时都遇到类似的问题。当我尝试通过命令行安装软件包时。
py -3.6 -m pip install mysql
我收到以下错误消息:
_mysql.c(29): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "mysql.h": No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\****\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\****~1\\AppData\\Local\\Temp\\pip-install-jjudeiox\\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\****~1\AppData\Local\Temp\pip-record-opzlo6th\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\****~1\AppData\Local\Temp\pip-install-jjudeiox\mysqlclient\