opt = SolverFactory('cplex', executable="/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx/cplex")如果使用可执行选项(如上所述),它将正常工作。如果不是,我们会得到以下错误:
ApplicationError: No executable found for solver 'cplex'发布于 2020-02-06 02:06:24
如果不想使用executable选项指定路径,则需要在PATH环境变量中添加以下目录:
/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx例如,您可以从命令行执行此操作,如下所示:
export PATH=$PATH:/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx如果这样做有效,那么您可以通过使用描述的here技术将其添加到您的~/.bash_profile中,从而使其成为永久性的
https://stackoverflow.com/questions/60079490
复制相似问题