我正在尝试在 Windows 10 上安装 gmpy 包。“pip install gmpy”停止并显示一条错误消息,提示需要 Microsoft Visual C++ 14.0。网上的各种说法都建议使用 Visual Studio 和 Visual C++ 构建实用程序进行安装。我已经这样做了。但之后“pip install gmpy”会显示一条很长的错误消息:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\stephen\appdata\local\programs\python\python36\include -Ic:\users\stephen\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc/gmpy.c /Fobuild\temp.win-amd64-3.6\Release\src/gmpy.obj
gmpy.c
c:\users\stephen\appdata\local\temp\pip-install-m5ym7nd7\gmpy\src\gmpy.h(30): fatal error C1083: Cannot open include file: 'gmp.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
其他各种消息来源建议https://www.lfd.uci.edu/~gohlke/pythonlibs/#gmpy,可以下载各种 .whl 文件。不幸的是,我用这些文件没有得到更好的结果:
C:\Users\Stephen\Downloads>pip install gmpy-1.17-cp34-none-win32.whl
gmpy-1.17-cp34-none-win32.whl is not a supported wheel on this platform.
C:\Users\Stephen\Downloads>pip install gmpy-1.17-cp34-none-win_amd64.whl
gmpy-1.17-cp34-none-win_amd64.whl is not a supported wheel on this platform.
我尝试了各种不同版本的 .whl 文件,结果相同。还有其他我没注意到的方法吗?