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

Numpy incompatibility across required packages on python 3.10/OS X #595

Open
ceesem opened this issue Aug 9, 2023 · 2 comments
Open

Numpy incompatibility across required packages on python 3.10/OS X #595

ceesem opened this issue Aug 9, 2023 · 2 comments

Comments

@ceesem
Copy link
Collaborator

ceesem commented Aug 9, 2023

I'm working on some tutorials right now that involve fresh installs of various CAVE packages that depend on cloud-volume. After doing a standard pip install cloud-volume in a python 3.10 environment, importing it throws the error:

ValueError                                Traceback (most recent call last)
Cell In[1], line 1
----> 1 import cloudvolume

File ~/miniconda3/envs/swdb2023-em/lib/python3.10/site-packages/cloudvolume/__init__.py:74
     71 __version__ = '8.25.0'
     73 # Register plugins
---> 74 from .datasource.precomputed import register as register_precomputed
     75 from .datasource.graphene import register as register_graphene
     77 register_precomputed()

File ~/miniconda3/envs/swdb2023-em/lib/python3.10/site-packages/cloudvolume/datasource/precomputed/__init__.py:3
      1 from typing import Optional, Union
----> 3 from .image import PrecomputedImageSource
      4 from .metadata import PrecomputedMetadata
      5 from .mesh import PrecomputedMeshSource

File ~/miniconda3/envs/swdb2023-em/lib/python3.10/site-packages/cloudvolume/datasource/precomputed/image/__init__.py:25
     23 from cloudvolume.scheduler import schedule_jobs, DEFAULT_THREADS
     24 from ....lib import Bbox, Vec, sip, first, BboxLikeType, toiter
---> 25 from .... import sharedmemory, chunks
     27 from ... import autocropfn, readonlyguard, ImageSourceInterface
     28 from .. import sharding

File ~/miniconda3/envs/swdb2023-em/lib/python3.10/site-packages/cloudvolume/chunks.py:23
     21 import pyspng
     22 import simplejpeg
---> 23 import compresso
     24 import crackle
     25 import fastremap

File compresso.pyx:1, in init compresso()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

It turns out that pip installs numpy 1.21.6 whenever it sees cloud-volume as an install requirement, and compresso seems allergic to that. This can be worked around by running pip install --upgrade numpy to bring numpy up to version 1.25.2. Importing works fine and basic functionality, at least on precomputed and graphene datasets, seems fine.

Looking at the pip dependencies, it appears that zfpy has oldest-supported-numpy as one of its requirements, which is forcing numpy to the lowest version supported by the current python version compatible with the platform+python version.

@ceesem
Copy link
Collaborator Author

ceesem commented Aug 9, 2023

After a bit more digging, I see that you brought up this issue before on zfpy and is still unresolved.

@ceesem
Copy link
Collaborator Author

ceesem commented Aug 11, 2023

This is broadly related to #576 in that this is another case of brittle interactions between supporting a great number of compression formats without optional installs.

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

1 participant