如何连接Cplex和pyomo?

问题描述 投票:0回答:1
opt = SolverFactory('cplex', executable="/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx/cplex")

如果使用可执行选项(如上所述),它将起作用。如果没有,我们得到以下错误:

ApplicationError: No executable found for solver 'cplex'
cplex pyomo
1个回答
0
投票

如果不想使用executable选项指定路径,则需要将以下目录添加到PATH环境变量:

/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx

例如,您可以从命令行执行此操作,如下所示:

export PATH=$PATH:/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx

如果可行,则可以使用~/.bash_profile中所述的方法将其添加到here中,以使其永久化>

© www.soinside.com 2019 - 2024. All rights reserved.