Open tjlca opened 4 years ago
pyOpt.pySLSQP
is the name of the module.
You want to use pyOpt.SLSQP
instead.
Have you built the modules?
You should run python setup.py build_ext
prior to using and installing pyOpt.
I have a similar issue. I managed to install pyOpt on my system (Ubuntu 20.04, python 3.8.5, gcc9) without errors and I ran python setup.py build_ext as suggested above before installing pyOpt by running python setup.py install. However when I want to run the example tp037.py I get the following error:
Traceback (most recent call last): File "tp037.py", line 98, in <module> from pyOpt import ALGENCAN ImportError: cannot import name 'ALGENCAN' from 'pyOpt' (/home/tim/Downloads/Fit-TDS-master/py3-env/lib/python3.8/site-packages/pyOpt/__init__.py)
Do you have any advice?
Looks like it was not installed correctly. Check for errors on your build.
Did you fix it?
from pyOpt import NSGA2
ImportError: cannot import name 'NSGA2' from 'pyOpt' (/Users/tghosh/Downloads/pyOpt-master/pyOpt/__init__.py)
File "<ipython-input-26-0efd7093218e>", line 1, in <module>
from pyOpt import SLSQP
ImportError: cannot import name 'SLSQP' from 'pyOpt' (/Users/tghosh/Downloads/pyOpt-master/pyOpt/__init__.py)
from pyOpt import pySLSQP
This works but object created using pySLSQP does not take an optimization problem as a parameter.