Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy API compatibility breaks 2.7.1 #12

Open
jonas-eschle opened this issue Mar 29, 2022 · 5 comments
Open

Numpy API compatibility breaks 2.7.1 #12

jonas-eschle opened this issue Mar 29, 2022 · 5 comments

Comments

@jonas-eschle
Copy link

With 2.7.1, there is an error when importing nlopt having a numpy version<1.22 installed.

Steps to reproduce:
install numpy<1.22, install nlopt

I think this is related to pypa/pip#9542

Error message:

RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jonas/anaconda3/envs/tmp38/lib/python3.8/site-packages/nlopt/__init__.py", line 1, in <module>
    from .nlopt import *
  File "/home/jonas/anaconda3/envs/tmp38/lib/python3.8/site-packages/nlopt/nlopt.py", line 20, in <module>
    from . import _nlopt
ImportError: numpy.core.multiarray failed to import
@codename5281
Copy link

Hello, exact same issue here, commenting to follow up potential developments.

@jonas-eschle
Copy link
Author

Hi @DanielBok, any news on this? It's quite an urgent issue because it is screwing up the installation of our package and therefore let's any CI that installs our package fail, anyone who uses our package basically.

This should not happen for patch releases I believe, so I hope for a fast resolvement, otherwise we can release a fix that is constraining the version to 2.7.0.
Let us know

@jonas-eschle jonas-eschle changed the title Numpy API compatibility issue in 2.7.1 [URGENT] Numpy API compatibility breaks 2.7.1 Apr 1, 2022
@DanielBok
Copy link
Owner

Hello @jonas-eschle, I think it would be better if you pinned it to 2.7.0. Based on what I read on the changelog, there shouldn't be any significant diff between 2 versions. I only plan to patch this project to support later releases of Python going forward.

@jonas-eschle
Copy link
Author

Hi @DanielBok, thanks a lot for your response! I see, that is quite unfortunate and maybe comes from a misunderstanding. The version numbering usually depicts major.minor.patch, where "patch" should not change compatibility. So if a fix is needed in any version (major.minor) it can be done by increasing the patch version.

So is this really supposed to be a breaking change in a patch version? I understand that you may wanna drop older version (we gladly want that as soon as we can too), it's however quite unconventional. Was there a specific problem that occured with older numpy versions in order to break in a patch version? Maybe something we can help with?

Many thanks for making nlopt accessible in Python btw, I quite enjoy the library!

@AntoineD
Copy link

We are facing the same issue, could you please prevent your package from installing numpy<1.22?

@jonas-eschle jonas-eschle changed the title [URGENT] Numpy API compatibility breaks 2.7.1 Numpy API compatibility breaks 2.7.1 Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants