0

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

这是我到目前为止所尝试的:

1/ 在 AMPL 上下载 64 位 Windows 的二进制文件 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: {}```
4

0 回答 0