Install on Windows

147 views
Skip to first unread message

Elena Fernández Bravo

unread,
Jul 7, 2023, 12:22:52 PM7/7/23
to SNOPT
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.
I've installed pyOptSparse following the Conda Build Instructions (https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/install.html#conda-build-instructions), and then I made the modification to the file pyoptsparse/pyoptsparse/pySNOPT/setup.py  (https://ccom.ucsd.edu/~optimizers/docs/snopt/faqs.html#other-issues).
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

Nicolò Pollini

unread,
Jan 9, 2024, 10:45:32 AM1/9/24
to SNOPT
Any success with this? I would also like to learn how to install SNOPT in Windows 11 to then use it through pyOptSparse.
Thank you!
Nicolo

Elena Fernández

unread,
Feb 22, 2024, 2:54:16 PM2/22/24
to SNOPT
No, unfortunately I was not able to install it.
-Elena
Reply all
Reply to author
Forward
0 new messages