首页 > 解决方案 > 在使用 Openmdao 的 Openaerostruct 中运行示例

问题描述

我已经运行了 Openmdao 和 Openaerostruct 中给出的基本示例,包括演练。但是,“run_aerostruct_uCRM.multipoint .py”示例之一抛出错误:

文件“C:\Users\Narahari\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py”,第 108 行,在 execfile exec(compile(f.read(), filename, 'exec'), namespace)

文件“D:/D_volume_ADE/Aircraft_Design_course/MDO_Aerospace/OpenAeroStruct-master/openaerostruct/examples/run_aerostruct_uCRM_multipoint.py”,第 28 行,从 openmdao.api 导入 IndepVarComp、Problem、ScipyOptimizeDriver、pyOptSparseDriver、SqliteRecorder、ExecComp、SqliteRecorder

ImportError: 无法从 'openmdao.api' 导入名称 'pyOptSparseDriver' (C:\Users\Narahari\Anaconda3\lib\site-packages\openmdao\api.py)

不知道出了什么问题,任何帮助将不胜感激提前感谢Narahari

标签: openmdao

解决方案


it looks like example requires pyoptsparse to run. You need to install pyoptsparse from here. However, the latest master branch of OpenAeroStruct has updated this example to not require that driver, using the scipy driver instead. So if you pull down the commit #8cee773 or newer you should be able to run it.


推荐阅读