Openmdao: Not able to use gradient free approaches. eg: NSGA2

150 Views Asked by At

I am working on windows platform and have set up all my requirements for NSGA2 solver but still it is not working. I have downloaded and installed MPI, MinGW, SWIG, Pyopt, pyoptsparse but still I am unable to use the pyoptsparse driver. If someone could help on this, it will be of a great help. Thanks I have pasted the error below

D:\Anaconda2\Scripts\python.exe D:/OpenMDAO/Mitul/Sellar/Sellar_MDF.py
Traceback (most recent call last):
  File "D:/OpenMDAO/Mitul/Sellar/Sellar_MDF.py", line 6, in <module>
    from openmdao.drivers.pyoptsparse_driver import pyOptSparseDriver
  File "d:\anaconda2\lib\site-packages\openmdao\drivers\pyoptsparse_driver.py", line 19, in <module>
    from openmdao.core.driver import Driver
  File "d:\anaconda2\lib\site-packages\openmdao\core\driver.py", line 15, in <module>
    from openmdao.util.options import OptionsDictionary
ImportError: No module named options
1

There are 1 best solutions below

1
On

it is difficult to get MPI and pyopt-sparse built correctly on windows. But It has been done successfully. You can see the docs here for detailed instructions

That being said... there is clearly something wrong with your OpenMDAO installation. That error implies that things are not being copied correctly into the installation folder. Since you're using anaconda, I suggest that you create a new anaconda env as follows:

conda create --name om2 python=2 numpy scipy matplotlib

then activate it with source activate om2 and try to re-install openmdao via pip. You can get the very latest by doing

pip install git+http://github.com/OpenMDAO/OpenMDAO.git@master

Once you've done that, before you try to get mpi/petsc/pyopt-sparse installed you should run our test suite. Follow our docs on that, and if the tests all pass you can move on to the other more advanced install steps.