使用 Pyomo 设置 CBC

问题描述

我的目标是将 cbc 与 pyomo 库一起使用。我在互联网上找到了一些资源,但我仍然无法使用它。

这是我目前尝试过的:

1/ 在 AMPL 上下载用于 64 位窗口的二进制文件 cbc.exe:https://ampl.com/products/solvers/open-source/

2/ 把二进制文件放在我项目的根文件夹中(分别放在执行模块的文件夹中)

3/ 将二进制文件添加到路径(根文件夹和执行模块的文件夹)

4/ SolverFactory('cbc.exe')

我收到以下错误

WARNING: Failed to create solver with name 'cbc.exe': Failed to set executable for solver asl. File with name=cbc.exe either does not exist or it is not executable.

[...]


The SolverFactory was unable to create the solver "cbc.exe"
and returned an UnkNownSolver object.  This error is raised at the point
where the UnkNownSolver object was used as if it were valid (by calling
method "solve").

The original solver was created with the following parameters:
        executable: cbc.exe
        type: cbc.exe
        _args: ()
        options: {}```

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)