pygrib
pygrib copied to clipboard
pip is not able to detect the libraries
I am trying to install pygrib using the following pip command
#!/bin/bash
pip install --global-option=build_ext
--global-option="-I/usr/local/grib_api/include/"
--global-option=build_ext
--global-option="-L/usr/local/jasper-1.900.1/lib/ -ljasper"
--global-option=build_ext
--global-option="-L/usr/local/grib_api/lib/ -lgrib_api"
--global-option=build_ext
--global-option="-L/usr/local/libpng_1.6.18/lib/ -lpng"
pygrib
Yet, I got the following errors gcc -pthread -shared -L/home/ahmed/anaconda3/lib -Wl,-rpath=/home/ahmed/anaconda3/lib,--no-as-needed build/temp.linux-x86_64-3.5/pygrib.o -L/opt/local/lib -L/opt/local/lib64 -L/opt/local/lib -L/opt/local/lib64 -L/opt/local/lib -L/opt/local/lib64 -L/usr/lib -L/usr/lib64 -L/usr/lib -L/usr/lib64 -L/home/ahmed/anaconda3/lib -Wl,--enable-new-dtags,-R/opt/local/lib -Wl,--enable-new-dtags,-R/opt/local/lib64 -Wl,--enable-new-dtags,-R/opt/local/lib -Wl,--enable-new-dtags,-R/opt/local/lib64 -Wl,--enable-new-dtags,-R/opt/local/lib -Wl,--enable-new-dtags,-R/opt/local/lib64 -Wl,--enable-new-dtags,-R/usr/lib -Wl,--enable-new-dtags,-R/usr/lib64 -Wl,--enable-new-dtags,-R/usr/lib -Wl,--enable-new-dtags,-R/usr/lib64 -lgrib_api -ljasper -lopenjpeg -lpng -lz -lpython3.5m -o build/lib.linux-x86_64-3.5/pygrib.cpython-35m-x86_64-linux-gnu.so /bin/ld: cannot find -lgrib_api /bin/ld: cannot find -ljasper /bin/ld: cannot find -lopenjpeg collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 Any ideas ! Thanks in advance
It's not finding the C lib dependencies.
See the installation docs at http://jswhit.github.io/pygrib/docs/index.html
Thanks, I saw the installation docs before, yet I already mentioned the C lib dependencies in pip command above.
Pip looks like unable to get that. however, it understand the include path location "--global-option="-I/usr/local/grib_api/include/" " as when I remove it, Pip complain that it couldn't find the include files. I am wondering what I should do to fix that. Also, I defined these pathes in .bashrc "set $GRIBAPI_DIR, $JASPER_DIR, $OPENJPEG_DIR, $PNG_DIR and $ZLIB_DIR", yet Pip did not get it.
I'm not a pip expert (in fact I rarely use it at all), so I can't tell you why that doesn't work. If I were you, I would make sure that the env vars (GRIBAPI_DIR, JASPER_DIR etc) are all set in the shell environment that you are invoking pip from. I don't think the --global-option args are necessary.
Thanks, I already included the env vars and I downloaded the package so as to install it manually. I got the same error. After some digging, I found that the file setup.cfg redefine the env vars, so I put the location of the GRIBAPI_DIR and it works. Yet, I am confused, if we are defining the env vars in .bashrc, why the Pygrib create such file-- setup.cfg. I mean, it seems that defining the env vars for Pygrib in bashrc is meaningless.
Thanks a lot.