importing pygrib in python -


in spite encountering no errors in pygrib installation, encountered following error when importing pygrib:

>>> import pygrib traceback (most recent call last):   file "<stdin>", line 1, in <module> importerror: /python/python-2.7.13/lib/python2.7/site-packages/pygrib.so: undefined symbol: __svml_round2_mask 

any advice on causing "undefined symbol" error?

undefined symbol errors caused 1 of 2 things:

  • incorrect linking during build process, or
  • a mismatch between environment used build binary or library, , environment in being run.

incorrect linking

if building pygrib module itself, make sure required library dependencies being linked, , in right order. based on missing symbol name, __svml_round2_mask, i'd guess pygrib.so compiled intel icc c compiler , needs linked math library containing svml (short vector math library) functions. it's difficult more specific without knowing more details of build environment, example, on linux, both icc , gcc (which both call gnu ld linking) need have math library specified on command line, , needs come after binary or library calling it.

evironment mismatch

if pygrib not being built (either explicitly, or part of pip or conda install command), have environment mismatch. happens when pygrib.so downloaded built against different libraries ones have installed. ideally, python binary packages built against vanilla set of libraries (e.g. "manylinux1" container linux wheels) run on systems, specialized , performance-critical packages need built particular optimizations or against uncommon libraries. if optimizations or libraries don't match between build system , system on resulting package install, undefined symbol error can result.

one way minimize occurrence of not mix-and-match package repositories possible. is, if you're using anaconda, pull packages anaconda. know, not possible, right?

if you're on linux, possible figure out mismatch using ldd command, example:

$ ldd -r /python/python-2.7.13/lib/python2.7/site-packages/pygrib.so

you'll see bunch of undefined symbols starting py or _py--ignore those, they're supplied python itself. in amongst those, you'll discover particular library needing __svml_round2_mask. @ full path carefully, , full paths of other libraries listed, , might suggest mismatch came from.

other suggestions

  • including more specifics in question, such os , how installed pygrib , dependencies, might enable offer more specific advice.
  • if title of question more specific, attract more attention.
  • have tried other pygrib packages? conda-forge lists several; 1 of them might match system.
  • have tried python-eccodes module instead? seems recommended successor pygrib.

good luck, hope in here helps!


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -