travis-ci共享库的路径或如何将共享库链接到python

时间:2018-02-16 08:42:31

标签: travis-ci travis-ci-cli

ci professional,

我无法弄清楚为什么这段代码找不到共享库。请参阅日志

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

拉取请求 https://github.com/alexlib/pyptv/pull/4 和构建https://travis-ci.org/alexlib/pyptv/builds/342237102

我们有一个C库(http://github.com/openptv/openptv)我们需要编译并使用Cython绑定添加到Python,然后我们通过绑定使用Python。测试在本地工作,但不适用于Travis-CI(优质服务)。我认为这是路径的一个简单问题,但我无法弄清楚如何处理这个问题。

提前致谢 亚历

1 个答案:

答案 0 :(得分:0)

我找到的答案是设置Mac OS X上所需的DYLD_LIBRARY_PATH:

  • 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