简体   繁体   English

在Windows上安装“ pygrib”软件包:“ Python.h”文件出现问题

[英]Installing “pygrib” package on Windows: problem with “Python.h” file

I'm trying to install the pygrib package using the "Thonny IDE" tool to manage packages but i got this Error: 我正在尝试使用“ 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:\Users\SSQ1\.thonny\BundledPython36\Scripts\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\SSQ1\AppData\Local\Temp\pip-record-x9xj51sk\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\SSQ1\.thonny\BundledPython36\include\site\python3.6\pygrib:
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
copying ncepgrib2.py -> build\lib.win32-3.6
running build_ext
building 'pygrib' extension
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\SSQ1\.thonny\BundledPython36\lib\site-packages\numpy\core\include -Ig2clib_src -IC:\Users\SSQ1\.thonny\BundledPython36\include -IC:\Users\SSQ1\AppData\Local\Programs\Thonny\include -IC:\Users\SSQ1\AppData\Local\Programs\Thonny\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\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" /Tcpygrib.c /Fobuild\temp.win32-3.6\Release\pygrib.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:\Users\SSQ1\.thonny\BundledPython36\Scripts\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\SSQ1\AppData\Local\Temp\pip-    record-x9xj51sk\install-record.txt --single-version-externally-managed --compile     --install-headers C:\Users\SSQ1\.thonny\BundledPython36\include\site\python3.6\pygrib" failed with error code 1 in C:\Users\SSQ1\AppData\Local\Temp\pip-install-b71fvftx\pygrib\


Return code: 

I got that it cannot find "Python.h" in the right Path but i cannot understand wich is the right one. 我知道它无法在正确的路径中找到“ Python.h”,但我无法理解“哪一个是正确的”。

Sorry for no more information but I've been using python for very little time 抱歉,没有更多信息,但是我使用python的时间很少

The Python interpreter which is built into Thonny does not include required files for building native packages from source. Thonny内置的Python解释器不包含用于从源代码构建本机软件包所需的文件。 In other words, you can't install this package with Thonny's built-in Python. 换句话说,您无法使用Thonny的内置Python安装此软件包。

You should install a separate Python from python.org and make Thonny use it as backend (Tools => Options => Interpreter). 您应该从python.org安装一个单独的Python,并让Thonny将其用作后端(工具=>选项=>解释器)。 After this you should be able to install this package (provided you have Visual Studio Tools properly set up). 之后,您应该能够安装该软件包(前提是您正确设置了Visual Studio Tools)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM