You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed nlopt but when trying to import, following error occurs:
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 22, in swig_import_helper
return importlib.import_module(mname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 676, in _load_unlocked
File "", line 573, in module_from_spec
File "", line 1233, in create_module
File "", line 241, in _call_with_frames_removed
ImportError: DLL load failed while importing _nlopt: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt_init_.py", line 1, in
from .nlopt import *
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 25, in
_nlopt = swig_import_helper()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 24, in swig_import_helper
return importlib.import_module('nlopt')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\importlib_init.py", line 126, in import_module
Just run into this problem myself under windows
So far I've been able to test that
C:\Python312\Lib\site-packages\nlopt\nlopt.dll can be loaded fine
C:\Python312\Lib\site-packages\nlopt\_nlopt.pyd seems to be where the problem is
pyd files are basically just dll files, so I'm wondering if this is related to the version of python I'm using
renaming it to a dll then trying to just import it fails which suggests there's a problem with the way it's being built
what this means is if you install under python 3.12 under windows
it drops down to nlopt version 2.6.2 for some reason because of the way the dependencies are setup
version 2.6.2 which is an old version which causes the issue
I've found that manually building the sources and copying the files over for 2.7.1 works under python 3.12
I'm currently trying to work out where the setup.py is in this repo if there is one
I have installed nlopt but when trying to import, following error occurs:
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 22, in swig_import_helper
return importlib.import_module(mname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 676, in _load_unlocked
File "", line 573, in module_from_spec
File "", line 1233, in create_module
File "", line 241, in _call_with_frames_removed
ImportError: DLL load failed while importing _nlopt: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt_init_.py", line 1, in
from .nlopt import *
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 25, in
_nlopt = swig_import_helper()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\site-packages\nlopt\nlopt.py", line 24, in swig_import_helper
return importlib.import_module('nlopt')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Serdar\AppData\Local\Programs\Python\Python311\Lib\importlib_init.py", line 126, in import_module
ModuleNotFoundError: No module named '_nlopt'
The text was updated successfully, but these errors were encountered: