I’m having an error installing NLOpt with Numpy
By default if I just use a clean venv on Windows and install NLOpt, it installs numpy as a dependency but it doesnt work.
When I install numpy == 1.19.3 which should work with nlopt, it gives this error message:
`—————————————————————————
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd
ImportError Traceback (most recent call last)
Cell In[6], line 2
1 import numpy as np
—-> 2 import nlopt
3 import pkg_resources
5 numpy.path
—-> 1 from .nlopt import *
3 version = ‘2.7.1’
18 # Import the low-level C/C++ module
19 if __package__ or "." in __name__:
—> 20 from . import _nlopt
21 else:
22 import _nlopt
ImportError: numpy.core.multiarray failed to import`
Now, curiously I somehow got this working on a different venv, but I have no idea what I did. I’m quite certain I followed exactly the same procedure (new venv, install numpy, install nlopt, import both)
But I can’t replicate that on my main project, or even any other folder. I am so confused…
Everything. Fresh Venvs in 3 different folders. Then install numpy and nlopt. It only worked once. And I have no idea why.