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

Tests failing due to numpy import error #305

Open
jcannon-gplates opened this issue Jan 9, 2025 · 3 comments
Open

Tests failing due to numpy import error #305

jcannon-gplates opened this issue Jan 9, 2025 · 3 comments
Assignees
Milestone

Comments

@jcannon-gplates
Copy link
Contributor

When I run the test pytestcases\test_5_seafloorgrid.py I get ImportError: numpy.core.multiarray failed to import in stripy in from . import _stripack in "spherical.py".

I'm using a pip venv with Python 3.12, stripy 2.3.3, numpy 2.2.0, pygplates 1.0.0rc1. And I'm on Windows 11.

It might be due to NumPy 2. Maybe stripy needs to be compiled against NumPy 2 in order to support both 1.x and 2.x. Or specify numpy<2.0 in its pyproject.toml/setup.py.

There's mention of stripy supporting Python 3.13 here, so maybe NumPy 2 is not the problem, though maybe that comment was meant for conda (and not pip).

By the way, I'm updating to pygplates>=1.0.0rc1 in #303, for which pyGPlates now supports NumPy 2.x (and 1.x).

So we may want to check our dependencies all support NumPy 2.x, otherwise I guess we'll need to specify numpy<2.0 for gplately 2.0 (if we're still encountering problems).

This is probably a question for @brmather

@jcannon-gplates jcannon-gplates added this to the release 2.0.0 milestone Jan 9, 2025
@jcannon-gplates
Copy link
Contributor Author

I can confirm that manually downgrading NumPy from 2.2.0 to 1.26.4 with pip install numpy==1.26.4 works around this issue.

@jcannon-gplates
Copy link
Contributor Author

I think we'll need to specify numpy<2.0 (in "pyproject.toml" and "setup.py") until all dependencies are compiled to support NumPy 2.x (see here).

@jcannon-gplates jcannon-gplates self-assigned this Jan 23, 2025
@michaelchin
Copy link
Contributor

I think we'll need to specify numpy<2.0 (in "pyproject.toml" and "setup.py") until all dependencies are compiled to support NumPy 2.x (see here).

Yes, please. Thank you.

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

2 participants