2017-09-13 4 views
0

pip을 사용하여 pygrib을 설치하는 데 문제가 있습니다. easy_install을 사용하여 pygrib을 설치하려고 시도했지만 비슷한 오류가 발생합니다.pip 설치 패키지 - 오류 코드 1/2로 실패했습니다

사실
c:\users\brandon\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 
    pygrib.c(242): fatal error C1083: Cannot open include file: 'grib_api.h': No such file or directory 
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 

, pygrib 내가 pip을 시도하거나 작동하지 않는 유일한 패키지입니다 :이 오류가

Command "C:\Users\Brandon\AppData\Local\Enthought\Canopy\edm\envs\User\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Brandon\\AppData\\Local\\Temp\\pip-build-veulay9n\\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\Brandon\AppData\Local\Temp\pip-ff_s5247-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Brandon\AppData\Local\Temp\pip-build-veulay9n\pygrib\ 

easy_install 사용 :

사용 pip 나는이 오류 easy_install - 설치하려고하는 모든 패키지에서 작동합니다. 여기서 무슨 일이 일어나고 어떻게이 문제를 해결할 수 있습니까?

답변

2

pygriblibgrib-api의 파이썬 래퍼입니다. pygrib을 컴파일하려면 libgrib-abi을 컴파일하고 라이브러리 및 헤더 파일을 설치해야합니다. 소스는 https://software.ecmwf.int/wiki/display/GRIB/Releases에서 다운로드하십시오.

+2

[Windows 지원은 실험적입니다.] (https://software.ecmwf.int/wiki/pages/viewpage.action?pageId=48109524), 그리고 여러분이 ' C 코드를 컴파일하거나 Windows에서 환경 변수를 설정하는 데 익숙하지 않은 경우 지침이별로 도움이되지 않습니다. –

0

pygrib에는 C로 작성된 하나 이상의 Python 확장 모듈이 포함되어 있으며 설치 과정에서 컴파일해야합니다.이 C 코드는 "grib_api.h"이라는 헤더 파일을 제공하는 라이브러리에 따라 달라집니다. 해당 C 라이브러리를 찾아서 설치하면 pygrib 설치가 제대로 작동합니다.