1

ci professionals,

I cannot figure out why this code cannot find the shared library. Please see the log

https://pastebin.com/KvJP9Ms3

    [31mImportError while importing test module '/home/travis/build/alexlib/pyptv/tests/test_pyptv_batch.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_pyptv_batch.py:1: in <module>
    from pyptv import pyptv_batch
pyptv/pyptv_batch.py:20: in <module>
    from optv.calibration import Calibration
E   ImportError: liboptv.so: cannot open shared object file: No such file or directory[0m
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
[1m[31m=========================== 1 error in 0.43 seconds ============================[0m

the pull request https://github.com/alexlib/pyptv/pull/4 and the build https://travis-ci.org/alexlib/pyptv/builds/342237102

We have a C library (http://github.com/openptv/openptv) that we need to compile and using Cython bindings add to Python, then we use Python through bindings. The tests work locally but not on Travis-CI (great service). I think it's a simple issue with paths, but I couldn't figure out how to deal with this.

Thanks in advance Alex

Alex
  • 118
  • 5
  • I saw that you found the answer by setting LD_LIBRARY_PATH, maybe add this as an accepted answer so others who find your question can get help? – brujoand Feb 23 '18 at 10:45

1 Answers1

0

The answer I have found was to set also the DYLD_LIBRARY_PATH that is required on Mac OS X:

  • export PATH=$PATH:/usr/local/lib
  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  • export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib
Alex
  • 118
  • 5