Hallo, I am trying for the first time to use NLopt in a Python project (built with Visual C++) but I can't make it work.
I have Windows 10 (64 bit), Python install 64 bit. I have: - downloaded the 64-bit "nlopt-2.4.2-dll64.zip", - successfully created import library by running the command "lib /def:libnlopt-0.def" from "VS2015 x64 Native Tools Command Prompt" - successfully run a basic C++ project from the tutorial. Now I want to make a Python project. As from the instructions: - I built a Python extension module "_nlopt.cp35-win_amd64.pyd" by running "python setup.py build_ext -inplace" in the folder where I had built the "libnlopt-0.lib" and "libnlopt-0.exp". - The Python module is generated, as well as "_nlopt.cp35-win_amd64.exp", "_nlopt.cp35-win_amd64.lib" and "nlopt-python.obj"in a newly created folder "build\temp.win-amd64-3.5\Release". - From my experience with Python wrapping, I should simply copy the generated "_nlopt.cp35-win_amd64.pyd" file into my Python project folder, then import the module with "import _nlopt". However I always get the ImportError "No module named _nlopt". - I have tried to "import nplot", to add the .pyd module to the site packages of my Python distribution, to sys.path.append(), but the module is never found. What am I missing to use NLopt Python? Maybe the generated "_nlopt.cp35-win_amd64.pyd" is not correct? Why in the tutorial the Python example starts with "import nlopt" when the module generated by setup.py is called _nplot? Thank you very much for your help. Fabio.
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
