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

Trackpy incompatible with Numpy 2.0 #768

Open
SiFroehl opened this issue Jul 1, 2024 · 3 comments
Open

Trackpy incompatible with Numpy 2.0 #768

SiFroehl opened this issue Jul 1, 2024 · 3 comments
Labels
maintenance Caused by new dependency versions

Comments

@SiFroehl
Copy link

SiFroehl commented Jul 1, 2024

Trackpy internally uses np.Inf which was removed in numpy version 2.0.0 (should use np.inf instead) leading in an error in multiple trackpy functions (such as link).
To replicate, install numpy 2.0.0 (newest version as of now) and trackpy 0.6.3 (newest version as of now), import both and call trackpy.link

@erikamoore
Copy link

I had the same issue. Here is how I fixed it: Uninstall numpy. Then, run pip install numpy==1.26.0. Hope that helps.

@nkeim
Copy link
Contributor

nkeim commented Jul 10, 2024

Thanks. The fix within the trackpy code is straightforward; you can see it in #770 and it will go in the next release. However, trackpy optionally uses PyTables to store data in files, and the PyTables team is still working on compatibility: PyTables/PyTables#1172 . So, even once #770 is merged, I recommend sticking with numpy 1, unless you are certain you will not use trackpy's storage features. That means one of

  • Install the default anaconda environment (from anaconda.org) which currently still includes numpy 1.26.
  • Use @erikamoore 's workaround if you use pip
  • Specify numpy=1 when you make a custom conda environment.

@nkeim nkeim added the maintenance Caused by new dependency versions label Jul 10, 2024
@nkeim
Copy link
Contributor

nkeim commented Jul 10, 2024

Version 0.6.4 is now available via pip install trackpy and should be on conda-forge by July 15. I'm leaving this issue open until PyTables is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Caused by new dependency versions
Projects
None yet
Development

No branches or pull requests

3 participants