-
Notifications
You must be signed in to change notification settings - Fork 10
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 v2.0 error with espresso v4.2.2 #83
Comments
ESPResSo doesn't officially support NumPy 2.0: https://github.com/espressomd/espresso/blob/4.2.2/requirements.txt#L4 The NumPy ecosystem is still migrating to version 2.0. On the SciPy roadmap, section NumPy, table "Python and NumPy version support per SciPy version" (click to unroll), only the most 2 recent versions of SciPy support NumPy 2.0. Similarly for Pint, only version 0.24.1 (released June 24th) and above support it. I would say it is too early for us to adopt NumPy 2.0. The Ubuntu noble release is also stuck with NumPy 1.26 until April 2026, and this OS is used by a significant fraction of our user base. Users can always pip install a newer NumPy, but they have to take care of choosing a version compatible with Cython, which itself depends on specific versions of the Python header files (for the C++ compiler). In addition, ESPResSo 4.2.2 has a lot of legacy Cython code and will never be able to use NumPy 2.0, unlike ESPResSo 4.3-dev which has almost no Cython code left and will, for some users, work with NumPy 2.0, if they happen to have the right combination of Python version and Cython version. Whether 4.3-dev truly is fully compatible with NumPy 2.0 is still an open question, because ESPResSo never adopted the NumPy ndarray API, so a lot more investigative work is needed from the ESPResSo side to figure out what works and what doesn't. |
Thank you for the detailed explanation :) python3 -m venv pymbe
source pymbe/bin/activate
python3 maintainer/configure_venv.py --espresso_path=/home/user/espresso/build # adapt path
python3 -m pip install -r requirements.txt my pymbe venv came with numpy v2.0. Maybe it's a good idea to limit the numpy version in the README.md, say |
No worries, managing Python dependencies is no easy task :-) It is true the PyMBE In ESPResSo, we adopted the NEP 29 policy standard when it comes to Python dependencies, i.e. we only support Python packages if they are still compatible with at least the oldest actively maintained NumPy release. To avoid updating the @pm-blanco Should we adopt such a schedule in pyMBE? |
Sounds reasonable to me. However, since we are still in a much earlier stage of development of the library than ESPResSo, it is likely that we need to update the |
Alright, I settled for Python package versions with a required minimum based on the Ubuntu 22.04 Python ecosystem, which should cover most of our users (#84). They are also in line with the existing requirements on the pint/pandas ecosystem, whose minimal required versions were published around 2022. NumPy 2.0 is now excluded. When we reach the stage where can adopt ESPResSo 4.3-dev (most likely long after the release that sorts out the pip installability of pyMBE), we can revisit these numbers and align them with Ubuntu 24.04. This will be no issue for EasyBuild, since those numbers are actually the ones used in I hope this explanation was not too confusing. There is probably a well-defined term to characterize the situation where updating a package's minor release ( |
@jngrad Thank you for taking care of this issue and for the explanation, it was quite clear to me! |
The development branch of ESPResSo now supports NumPy 2.0 and 2.1 (espressomd/espresso#4992). Support for NumPy 2.2 was introduced in ESPResSo 4.2.2 in openSUSE:Factory via request 1200197. This support should be considered experimental. The challenging part is finding out a version of Python, Cython, and NumPy that works well together; we cannot really offer help here, because it is heavily influenced by a user's environment and operating system. |
When running peptide.py with numpy 2.0 and espresso v4.2.2 there seems to be an issue.
There is a fix which can be found on stackoverflow that basically suggests to downgrade the numpy version with
(pymbe) pip install "numpy<2"
Did not run into this problem with espresso v4.3 and numpy v2.0
The text was updated successfully, but these errors were encountered: