Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing pygrib Package

Apologies in advance for what is probably a bad/poorly phrased question, but I merely dabble in programming and am very unfamiliar with under the hood aspects of package installation, etc.

Basically, I am trying to install the pygrib package (available here: https://github.com/jswhit/pygrib) via a cygwin terminal.

I am running Python 2.7.3 32-bit on Windows 10.

Originally I encountered the missing vcvarsall.bat error the first time I tried to run 'python seteup.py build' and followed the advice here: error: Unable to find vcvarsall.bat

After installing the MS Visual Studio package, I have made it past that error and to another I do not understand with the following output:

$ python setup.py build
reading from setup.cfg...running build
running build_py
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Matthew\Anaconda2\lib\site-packages\numpy\core\include -I/usr/local\include -I/usr/local\include -I/usr/local\include/jasper -I/usr/local\include -I/usr\include -I/usr\include -Ig2clib_src -IC:\Users\Matthew\Anaconda2\include -IC:\Users\Matthew\Anaconda2\PC /Tcpygrib.c /Fobuild\temp.win32-2.7\Release\pygrib.obj
pygrib.c
c:\users\matthew\anaconda2\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 9.0\\VC\\BIN\\cl.exe' failed with exit status 2

Obviously it's still looking for some other files, or needs other environment variables defined, but I'm at a loss as to how to proceed and I'm far from an expert when it comes to any of this.

I'd also be glad to try something completely different if you have a better way to go about this process entirely.

I have tried pip and the conda installer, but have not had any luck with them either.

Thank you in advance for anything you can offer.

like image 551
Matt Stalley Avatar asked Feb 25 '16 22:02

Matt Stalley


People also ask

How do I install a Python package?

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

Can you pip install a private repo?

Read the Docs uses pip to install your Python packages. If you have private dependencies, you can install them from a private Git repository or a private repository manager.

Can you pip install from github?

You can deploy Git locally, or use it via a hosted service, such as Github, Gitlab or Bitbucket. One of the advantages of using pip together with Git is to install the latest commits of unreleased Python packages as branches from Github.


1 Answers

Better to use linux on virtual machine within Windows ten. Then you can install pygrib without pain. As you are trying to play with meteorological data, it is recommended to install Linux and it will help you at may places. There is even Anaconda has a package (only for Linux and Mac). You can install using:-

conda install -c conda-forge pygrib=2.0.1

For your specif case following link might be useful:-

https://github.com/jswhit/pygrib/issues/19

https://github.com/jswhit/pygrib/pull/18 and https://github.com/conda-forge/ecmwf_grib-feedstock/issues/5

Gud luck.

like image 150
sundar_ima Avatar answered Sep 21 '22 07:09

sundar_ima