Hello,
I was planning on using SNOPT with pyOptSparse on Windows 11. I've been trying to install it with no success, I've looked on the SNOPT website and forum, but I couldn't make it work.
Next, I rebuilt/installed pyOptSparse and set up the license by adding the location of the library files (.lib and .dll) to the system path.
The only step I skipped was "Make sure you have also set DYLD_LIBRARY_PATH (on macOS) or LD_LIBRARY_PATH (on Linux) to the location of the SNOPT library ", I did not know how to do this on Windows.
Is there anything else I should be doing to set up SNOPT?
This is the error I get:
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\openmdao\drivers\pyoptsparse_driver.py", line 498, in run
opt = getattr(_tmp, optimizer)()
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\pyoptsparse\pySNOPT\pySNOPT.py", line 88, in __init__
raise Error("There was an error importing the compiled snopt module")
Error: There was an error importing the compiled snopt module
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\elena\Desktop\UIUC\Research\MSAC_Reseach\POETS\SPI2-MSAC\Dymos-Lagrange-PRBDM\cubesatode_onecomp.py", line 499, in <module>
dm.run_problem(p, simulate=True)
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\dymos\run_problem.py", line 92, in run_problem
failed = _refine_iter(problem, refine_iteration_limit, refine_method, case_prefix=case_prefix,
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\dymos\grid_refinement\refinement.py", line 36, in _refine_iter
failed = problem.run_driver(case_prefix=f'{_case_prefix}{refine_method}_0_'
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\openmdao\utils\hooks.py", line 131, in execute_hooks
ret = f(*args, **kwargs)
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\openmdao\core\problem.py", line 709, in run_driver
return self.driver.run()
File "C:\Users\elena\anaconda3\envs\py39\Lib\site-packages\openmdao\drivers\pyoptsparse_driver.py", line 504, in run
raise ImportError(msg)
ImportError: Optimizer SNOPT is not available in this installation.
Thank you,
Elena