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

pyarrow dependency conflict prevents importing teehr in Python 3.10 environment #236

Open
jarq6c opened this issue Aug 26, 2024 · 0 comments

Comments

@jarq6c
Copy link

jarq6c commented Aug 26, 2024

To duplicate:

# Install teehr using pip
pip install 'teehr @ git+https://github.com/RTIInternational/teehr@main'

Then import teehr

# Python 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] on linux
from teehr.loading.nwm import retrospective_points as nwm_retro
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.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'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
  File "env/lib/python3.10/site-packages/pandas/__init__.py", line 26, in <module>
    from pandas.compat import (
  File "env/lib/python3.10/site-packages/pandas/compat/__init__.py", line 27, in <module>
    from pandas.compat.pyarrow import (
  File "env/lib/python3.10/site-packages/pandas/compat/pyarrow.py", line 8, in <module>
    import pyarrow as pa
  File "env/lib/python3.10/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
AttributeError: _ARRAY_API not found

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.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'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<stdin>", line 1, in <module>
  File "env/lib/python3.10/site-packages/pandas/__init__.py", line 49, in <module>
    from pandas.core.api import (
  File "env/lib/python3.10/site-packages/pandas/core/api.py", line 9, in <module>
    from pandas.core.dtypes.dtypes import (
  File "env/lib/python3.10/site-packages/pandas/core/dtypes/dtypes.py", line 24, in <module>
    from pandas._libs import (
  File "env/lib/python3.10/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
AttributeError: _ARRAY_API not found

I found this error triggered when importing pandas due to pyarrow. I resolved the issue by updating pyarrow, but then pip complained:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
teehr 0.3.28 requires pyarrow<15.0.0,>=14.0.1, but you have pyarrow 17.0.0 which is incompatible.

teehr appears to work normally with pyarrow 17.0.0

@RTIInternational RTIInternational deleted a comment Aug 26, 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

5 participants
@jarq6c and others