应用程序错误:在 Pyomo 中找不到解算器“ipopt”的可执行文件

ZHE*_*HAO 5 python executable ipopt pyomo

我正在学习 Pyomo 并尝试使用 ipopt 来解决示例问题。但最初,我已经安装了软件包,然后它总是显示没有找到 ipopt 。之后我重新安装了很多次,现在显示

'''WARNING: Could not locate the 'ipopt' executable, which is required for solver
    ipopt
---------------------------------------------------------------------------
ApplicationError                          Traceback (most recent call last)
<ipython-input-2-2e55f87657f9> in <module>
      1 model.N=50
      2 instance = model.create_instance()
----> 3 results = opt.solve(instance) # solves and updates instance

D:\Anacondo\lib\site-packages\pyomo\opt\base\solvers.py in solve(self, *args, **kwds)
    514         """ Solve the problem """
    515 
--> 516         self.available(exception_flag=True)
    517         #
    518         # If the inputs are models, then validate that they have been

D:\Anacondo\lib\site-packages\pyomo\opt\solver\shellcmd.py in available(self, exception_flag)
    116             if exception_flag:
    117                 msg = "No executable found for solver '%s'"
--> 118                 raise ApplicationError(msg % self.name)
    119             return False
    120         return True

ApplicationError: No executable found for solver 'ipopt'
'''**bold**
Run Code Online (Sandbox Code Playgroud)

斜体

引用

我不知道如何修复它,我在 D 桌而不是 C 桌安装了 anaconda。任何人都可以帮助我,我需要它来完成一个月内的作业和考试。谢谢。

ZHE*_*HAO 1

通过安装最新版本的anacondo和3.11版本的ipopt已经解决了这个问题