qiskitnlopt

Unable to install NLopt for Qiskit


So I am following the instructions on this site, https://qiskit.org/documentation/stubs/qiskit.algorithms.optimizers.nlopts.html#module-qiskit.algorithms.optimizers.nlopts

However, I am able to run this command

./configure --enable-shared --with-python

As there is no file nor repository named with configure. I have qiskit and installed NLopt already. It will be great if anyone can help me with that ><

I expect to be able to follow the instruction and run NLopt on my qiskit code

This is my current situation:

nlopt-2.7.1 % ./configure --enable-shared --with-python

zsh: no such file or directory: ./configure


Solution

  • The docs above also include a link to nlopt's installation instructions. You should be able to follow things from there to install it to your Python environment that you are using with Qiskit. As you can see from the nlopt version listed there the instructions were written some time ago given the version shown there and it seems the installation overview given there may be outdated given the latest nlopt version.

    BUT... from checking it now seems to be on PyPi so doing a pip install nlopt should do it - it was not available via PyPi when the instructions were written.

    FYI:: As it seems the instructions need to be reviewed I created this issue to have the instructions revised https://github.com/Qiskit/qiskit-terra/issues/9011