首页 文章

SCIP:导入Model时出现PySCIPOpt错误

提问于
浏览
0

`dfg @dfg:〜/ prog / scipoptsuite-4.0.1 / build $ cmake .. -DREADLINE = off - 构建类型:发布 - 构建共享库:ON - 构建类型:发布 - 旧编译器的LEGACY模式:OFF - 找不到IPOPT(缺少:IPOPT_LIBRARIES) - 找不到CRITERION(缺少:CRITERION_LIBRARY CRITERION_INCLUDE_DIR) - 已找到以下可选包:

  • ZLIB

  • GMP

  • 已找到以下必需的包:

  • BISON

  • FLEX

  • SOPLEX

  • SCIP

  • 未找到以下OPTIONAL包:

  • IPOPT

  • 标准

  • 配置完成 - 生成完成 - 构建文件已写入:/ home / dfg / prog / scipoptsuite-4.0.1 / build`

error : libscip.so not found我正在尝试运行github中提供的'atsp.py'示例,但是我遇到了一个错误:

/home/dfg/thesis/programming/python_envs/scip_env/bin/python3.6 atsp.py
Traceback (most recent call last):
  File "atsp.py", line 10, in <module>
    from pyscipopt import Model, quicksum, multidict
  File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module>
    from pyscipopt.scip      import Model
ImportError: /opt/scipoptsuite-4.0.1/lib/libscip.so: undefined symbol: history_length

我的机器是Ubuntu 16.04 64位,SCIP Optimization 4.0.1安装在/opt/scipoptsuite-4.0.1

我正在使用Python 3.6和Python编辑器Pycharm的virtualenv Python环境 .

我真的被卡住了 .

enter image description here

我用CMake重新安装了scipoptsuite然后在scipoptdir中进行测试工作正常 . 我也有子目录lib和包含[https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.rst]中提到的 . 我也运行这个命令 make install INSTALLDIR=$SCIPOPTDIR SHARED=true . 然后我获得了以下错误 (scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python3.6 atsp.py Traceback (most recent call last): File "atsp.py", line 10, in <module> from pyscipopt import Model, quicksum, multidict File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module> from pyscipopt.scip import Model ImportError: libscip.so: cannot open shared object file: No such file or directory 我是否必须 Build 一些链接或导出变量?非常感谢你 !问候

1 回答

  • 0

    谢谢@mattmillen,我做了你的建议 . 我删除了以前的scipsuiteopt,然后重新安装cmake和readline off . 在命令行中工作正常 (scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python atsp.py Miller-Tucker-Zemlin's model: Optimal value: 330.0 x(1,4) = 1.0 x(2,3) = 1.0 x(3,5) = 1.0 x(4,2) = 1.0 x(5,1) = 1.0 u(5) = 4.0 u(2) = 2.0

    此外,我将位于 ./scipoptsuite/build/lib/libscip.solibscip.so 复制到 /usr/local/lib/libscip.so . 然后,这也适用于编辑器PyCharm :)

相关问题