gpt4 book ai didi

python - 应用程序错误 : No executable found for solver 'ipopt' in Pyomo

转载 作者:行者123 更新时间:2023-12-05 00:55:14 26 4
gpt4 key购买 nike

我正在学习 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**

斜体

quote

我不知道如何修复它,我将 anaconda 安装在 D table 而不是 C table 。谁能帮助我,我需要它来完成一个月后的作业和考试。谢谢。

最佳答案

安装 3.13.1 后我遇到了同样的问题。我所做的只是下载3.11.1,然后将ipopt.exe保存在C:\ProgramData\Anaconda3\Library\bin

然后就可以了。

关于python - 应用程序错误 : No executable found for solver 'ipopt' in Pyomo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64912995/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com