I have the same problem that was presented here.
I am not using anaconda.
I am attempting to run a program importing nlopt in Pycharm and have downloaded the nlopt package in the package installer. After installing it there, I still get the same error message.
Then I tried to install it via the command prompt: pip3 install nlopt
I am still getting the same error.
What could be the problem? I am not having this problem with other packages such as numpy, pandas, scipy, matplotlib, etc.
Don't install from pypi. Download the wheel from here instead: https://www.lfd.uci.edu/~gohlke/pythonlibs/#nlopt (it's linked to from NLopt's documentation, under the section NLopt on Windows). Choose the version that matches your Python version. For example, if it's Python 3.11, you should download then one containing cp311.
To install it, execute the following in a command prompt or terminal
where
path_to_wheel.whlis where you downloaded the wheel.Just for the record, the one from pypi.org mysteriously contains both
_nlopt.pydandnlopt.dll. The one from the above link only has_nlopt.pyd.