在Windows上安装"pygrib"软件包:文件"Python.h"问题



我正在尝试使用"Thonny IDE"工具来安装pygrib软件包来管理软件包,但是我收到此错误:

Collecting pygrib
Downloading 
https://files.pythonhosted.org/packages/a1/b3/04bd9b0e9f19ca7195e33975da7004602b 6abed3c48b779a06332e197e60/pygrib-2.0.3.tar.gz (21.4MB)
Installing collected packages: pygrib
  Running setup.py install for pygrib: started
Running setup.py install for pygrib: finished with status 'error'
Complete output from command    C:UsersSSQ1.thonnyBundledPython36Scriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\SSQ1\AppData\Local\Temp\pip-install-b71fvftx\pygrib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersSSQ1AppDataLocalTemppip-record-x9xj51skinstall-record.txt --single-version-externally-managed --compile --install-headers C:UsersSSQ1.thonnyBundledPython36includesitepython3.6pygrib:
running install
running build
running build_py
creating build
creating buildlib.win32-3.6
copying ncepgrib2.py -> buildlib.win32-3.6
running build_ext
building 'pygrib' extension
creating buildtemp.win32-3.6
creating buildtemp.win32-3.6Release
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023binHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:UsersSSQ1.thonnyBundledPython36libsite-packagesnumpycoreinclude -Ig2clib_src -IC:UsersSSQ1.thonnyBundledPython36include -IC:UsersSSQ1AppDataLocalProgramsThonnyinclude -IC:UsersSSQ1AppDataLocalProgramsThonnyinclude "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023include" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17763.0cppwinrt" /Tcpygrib.c /Fobuildtemp.win32-3.6Releasepygrib.obj
pygrib.c
pygrib.c(4): fatal error C1083: Non Å  possibile aprire il file inclusione: 'Python.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe' failed with exit status 2
----------------------------------------
Command "C:UsersSSQ1.thonnyBundledPython36Scriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\SSQ1\AppData\Local\Temp\pip-install-b71fvftx\pygrib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersSSQ1AppDataLocalTemppip-    record-x9xj51skinstall-record.txt --single-version-externally-managed --compile     --install-headers C:UsersSSQ1.thonnyBundledPython36includesitepython3.6pygrib" failed with error code 1 in C:UsersSSQ1AppDataLocalTemppip-install-b71fvftxpygrib

Return code: 

我知道它无法在正确的路径中找到"Python.h",但我无法理解哪个是正确的。

很抱歉没有更多信息,但我使用 Python 的时间很短。

内置在

Thonny 中的 Python 解释器不包含从源代码构建本机包所需的文件。换句话说,你不能用Thonny的内置Python安装这个包。

你应该安装一个独立于 python.org 的Python,并让Thonny使用它作为后端(工具=>选项=>解释器)。在此之后,您应该能够安装此包(前提是您已正确设置Visual Studio Tools)。

相关内容

  • 没有找到相关文章

最新更新