【问题标题】:travis-ci path to the shared library or how to link shared library to pythontravis-ci 共享库的路径或如何将共享库链接到 python
【发布时间】:2018-02-16 08:42:30
【问题描述】:

ci 专业人士,

我不明白为什么这段代码找不到共享库。请看日志

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(优质服务)上。我认为这是一个简单的路径问题,但我不知道如何处理这个问题。

提前致谢 亚历克斯

【问题讨论】:

  • 我看到您通过设置 LD_LIBRARY_PATH 找到了答案,也许将此添加为已接受的答案,以便其他发现您的问题的人可以获得帮助?

标签: travis-ci travis-ci-cli


【解决方案1】:

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

  • 导出 PATH=$PATH:/usr/local/lib
  • 导出 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  • 导出 DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多