Skip to content

Conflicting requirements for numpy versions #4

Description

@Rodgers-PAC-Lab

I've forked the repo so I can run it offline working on Linux Mint, and I'm having some issues with the numpy version. Requirements.txt has the numpy requirement as "numpy>=1.26.3,<2.0" and when I ran pip install -r requirements.txt it installed numpy 1.26.3. However, when I try streamlit run ABRA.py it gives this error:

ImportError: cannot import name 'trapezoid' from 'numpy' (.../miniconda3/envs/abranalysis/lib/python3.11/site-packages/numpy/__init__.py)

File ".../abranalysis/ABRA.py", line 9, in <module>
    from utils.plotting import *
File ".../abranalysis/utils/plotting.py", line 5, in <module>
    import fdasrsf as fs
File ".../miniconda3/envs/abranalysis/lib/python3.11/site-packages/fdasrsf/__init__.py", line 124, in <module>
    from .umap_metric import efda_distance, efda_distance_curve
File ".../miniconda3/envs/abranalysis/lib/python3.11/site-packages/fdasrsf/umap_metric.py", line 13, in <module>
    from numpy import (

This is apparently because it was called 'trapz' instead 'trapezoid' before numpy 2.0. If I upgrade to numpy 2.0, I get a different error: ImportError: numpy.core.umath failed to import

The terminal logs include the note:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

I imagine the numpy 'trapezoid' error is easier to fix than an entire module being compiled for an older version of numpy so I'll work on figuring that out, but if you already have a fix, that would save me some time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions