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

Error loading file on M1 Mac #101

Closed
emay2022 opened this issue Jan 19, 2022 · 40 comments · Fixed by #102
Closed

Error loading file on M1 Mac #101

emay2022 opened this issue Jan 19, 2022 · 40 comments · Fixed by #102
Labels
admin Administrative / planning bug Something isn't working

Comments

@emay2022
Copy link

emay2022 commented Jan 19, 2022

System and Software

  • aicspylibczi Version: 3.0.4
  • Python Version: 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:07) \n[Clang 11.1.0 ]
  • Operating System: M1 Mac

Description

A clear description of the bug

When I attempted to load a file with this library I got the following error:

File ~/mambaforge/envs/micro/lib/python3.9/site-packages/aicspylibczi/CziFile.py:60, in CziFile.__init__(self, czi_filename, verbose)
     57 self._bytes = self.convert_to_buffer(czi_filename)
     58 self.czifile_verbose = verbose
---> 60 import _aicspylibczi
     62 self.czilib = _aicspylibczi
     63 self.reader = self.czilib.Reader(self._bytes)

ImportError: dlopen(/Users/Elizabeth/mambaforge/envs/micro/lib/python3.9/site-packages/_aicspylibczi.cpython-39-darwin.so, 0x0002): tried: '/Users/Elizabeth/mambaforge/envs/micro/lib/python3.9/site-packages/_aicspylibczi.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_aicspylibczi.cpython-39-darwin.so' (no such file), '/usr/lib/_aicspylibczi.cpython-39-darwin.so' (no such file)

Expected Behavior

The file loads without an error

Reproduction

import aicspylibczi
out= aicspylibczi.CziFile("Path-to-czi-file.czi")

Environment

Any additional information about your environment

cc @ianhi

@evamaxfield
Copy link
Collaborator

Hello @emay2022!

To be honest, I don't think we personally have a good solution other than saying: "you should try building the library yourself."

I think @psobolewskiPhD will have the best insight into how to get this library to build on M1 macs

cc @toloudis

@evamaxfield evamaxfield added bug Something isn't working admin Administrative / planning labels Jan 19, 2022
@toloudis
Copy link
Collaborator

toloudis commented Jan 19, 2022

Of interest:
https://github.com/AllenCellModeling/aicspylibczi/blob/main/.github/workflows/py-build-main.yml

See if cibuildwheel (and github actions, for that matter) supports M1 macs, and what setting we would need to include to test that...

@ianhi
Copy link

ianhi commented Jan 19, 2022

To be honest, I don't think we personally have a good solution other than saying: "you should try building the library yourself."

This would be fine if the wheel didn't install wihout issues. I think you're currently distributing a "universal" wheel that may not actually be universal.

See if cibuildwheel (and github actions, for that matter) supports M1 macs, and what setting we would need to include to test that...

I believe it does. I think i've helped set this up elsewhere

@evamaxfield
Copy link
Collaborator

Looks like cibuildwheel supports MACOS arch: pypa/cibuildwheel#484

We may just need to add arm64 to our CIBW_ARCHS_MACOS list

@ianhi
Copy link

ianhi commented Jan 19, 2022

basically this: project-gemmi/gemmi@7d36d41

@ianhi
Copy link

ianhi commented Jan 19, 2022

or alternatively via pyproject.toml: https://github.com/project-gemmi/gemmi/pull/164/files

@evamaxfield
Copy link
Collaborator

@ianhi mind making a PR with what you think will fix?

@psobolewskiPhD
Copy link

psobolewskiPhD commented Jan 19, 2022

OK. so pip shows that aicspylibczi now has a wheel on pip that is Universal2, so it should work for arm64 M1
But if you try: pip install aicspylibczi
It will fail as you note, so it's somehow not a proper universal wheel—maybe its x86/PPC?
Anyhow you can do:

git clone https://github.com/AllenCellModeling/aicspylibczi.git --recurse-submodules
CC=gcc-11 CXX=g++-11  pip install .

And it should just build.

Edit: too slow!
Edit: y'all let me know and I can test anything M1 related!

@psobolewskiPhD
Copy link

BTW, those CC flags may not be needed. Either way, it's odd to me that pip install . works while pip install aicspylibczi --no-binary=aicspylibczi fails. Here's the error and full log below:

CMake Error: The source directory "/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b" does not appear to contain CMakeLists.txt.

Collecting aicspylibczi
  Using cached aicspylibczi-3.0.4.tar.gz (27 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.14.1 in ./Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages (from aicspylibczi) (1.22.0)
Skipping wheel build for aicspylibczi, due to binaries being disabled for it.
Installing collected packages: aicspylibczi
    Running setup.py install for aicspylibczi ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py'"'"'; __file__='"'"'/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-record-gcrxj2gt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/include/python3.9/aicspylibczi
         cwd: /private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/
    Complete output (64 lines):
    /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      warnings.warn(
    running install
    /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.macosx-11.0-arm64-3.9
    creating build/lib.macosx-11.0-arm64-3.9/aicspylibczi
    copying aicspylibczi/_version.py -> build/lib.macosx-11.0-arm64-3.9/aicspylibczi
    copying aicspylibczi/CziFile.py -> build/lib.macosx-11.0-arm64-3.9/aicspylibczi
    copying aicspylibczi/__init__.py -> build/lib.macosx-11.0-arm64-3.9/aicspylibczi
    copying aicspylibczi/types.py -> build/lib.macosx-11.0-arm64-3.9/aicspylibczi
    running egg_info
    writing aicspylibczi.egg-info/PKG-INFO
    writing dependency_links to aicspylibczi.egg-info/dependency_links.txt
    writing requirements to aicspylibczi.egg-info/requires.txt
    writing top-level names to aicspylibczi.egg-info/top_level.txt
    reading manifest file 'aicspylibczi.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'aicspylibczi.egg-info/SOURCES.txt'
    running build_ext
    CMake Error: The source directory "/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py", line 107, in <module>
        setup(
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/setuptools/command/install.py", line 68, in run
        return orig.install.run(self)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/command/install.py", line 546, in run
        self.run_command('build')
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
        _build_ext.run(self)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py", line 104, in build_extension
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
      File "/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/build/lib.macosx-11.0-arm64-3.9', '-DPYTHON_EXECUTABLE=/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/bin/python3.9', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py'"'"'; __file__='"'"'/private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-install-1sp37l6l/aicspylibczi_b5128c30ed0b4a64a5acb995ab5bf01b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/sy/y3_x27j14cxg3_vhycs6cr_h0000gn/T/pip-record-gcrxj2gt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/include/python3.9/aicspylibczi Check the logs for full command output.

@evamaxfield
Copy link
Collaborator

Reopening this issue. We are trying another variant of the CIBuildWheel stuff. If anyone has time to test the produced wheels, they will likely be available in an hour.

https://github.com/AllenCellModeling/aicspylibczi/actions/runs/1746866957

@evamaxfield evamaxfield reopened this Jan 25, 2022
@psobolewskiPhD
Copy link

I just downloaded the artifact. It now has wheels marked universal2 which would be x86-64/arm64. But the installed .so is not fat, just x86-64

╰─ ll _aicspylibczi.cpython-39-darwin.so                         (napari-env) ─╯
.rwxr-xr-x 1.7M piotrsobolewski 25 Jan 20:39 _aicspylibczi.cpython-39-darwin.so*
╭─ ~/dev/miniforge3/envs/napari-env/lib/python3.9/site-packages ········· ✔ ─╮
╰─ lipo -info _aicspylibczi.cpython-39-darwin.so                 (napari-env) ─╯
Non-fat file: _aicspylibczi.cpython-39-darwin.so is architecture: x86_64

@evamaxfield
Copy link
Collaborator

I have no idea what this means 🤡

Sounds like it doesn't work?

@psobolewskiPhD
Copy link

psobolewskiPhD commented Jan 25, 2022

Yea, universal2 should be FAT, so include compiled x86-64 and arm64 versions. But it's non-fat just x86-64. So the build system is packaging correctly, but not compiling arm64 versions.
Edit: to be explicit that means the same error as above when trying to open a .czi:

ImportError: dlopen(/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/_aicspylibczi.cpython-39-darwin.so, 0x0002): tried: '/Users/piotrsobolewski/Dev/miniforge3/envs/napari-env/lib/python3.9/site-packages/_aicspylibczi.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_aicspylibczi.cpython-39-darwin.so' (no such file), '/usr/lib/_aicspylibczi.cpython-39-darwin.so' (no such file)

Edit2: the key being: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

@evamaxfield
Copy link
Collaborator

I have no idea what to do anymore. This is now just an open call for help from anyone who sees this issue.

@psobolewskiPhD
Copy link

I'm guessing it's the cpp workflow that's doing the actual _aicspylibzi...so building?
https://github.com/AllenCellModeling/aicspylibczi/blob/main/.github/workflows/cpp-build-main.yml

So I think maybe there needs to be a detect for arm64 and the cmake arch flag set?
I'll do some googles.

@psobolewskiPhD
Copy link

OK, so I'm pretty certain the issue with builds is due to no cross-compilation flags being passed to cmake and the runners being x86. So the cmake part of the build is always x86 and then it's just packaged by cibuildwheel into arm64, universal2, or whatever. It's always the same x86 binary of the key compiled library.
Here's some stuff I dug up:
pypa/cibuildwheel#582

And here's a possible solution, but I think it uses a different build system (scikit-build):
nmwsharp/robust-laplacians-py#8
I'll keep poking around, but one problem I have is I have no clue how to test this build stuff...

@evamaxfield
Copy link
Collaborator

I'll keep poking around, but one problem I have is I have no clue how to test this build stuff...

If you make a PR, you could update the py-build-pr file: https://github.com/AllenCellModeling/aicspylibczi/blob/main/.github/workflows/py-build-pr.yml

to include the build wheel job and then download any of the wheels built as a part of that push (this is the wheel building part of the workflow that you could add to a pr workflow: https://github.com/AllenCellModeling/aicspylibczi/blob/main/.github/workflows/py-build-main.yml#L78)

@psobolewskiPhD
Copy link

Not fully 'getting' that ⬆️ at the moment, BUT:
I think that the solution here:
https://github.com/nmwsharp/robust-laplacians-py/pull/8/files
actually doesn't use any new build tools or anything, since that packages just uses setup.py and setuptools.

@toloudis
Copy link
Collaborator

That looks very promising, that's probably exactly what we need.

@toloudis
Copy link
Collaborator

I attempted to add the changes from the above mentioned solution.
@psobolewskiPhD would you be willing to open the build artifacts and see if the wheels look correct?
https://github.com/AllenCellModeling/aicspylibczi/actions/runs/1843834345#artifacts

@psobolewskiPhD
Copy link

Sorry I never got a chance to push this further!
I got the artifact and installed all of them one by one.
They all return the proper lipo -info either arm64 (if non-fat) or the proper fat (x96_64, arm64)!
🎉

Here's the 3.9's

artifact/aicspylibczi-3.0.4-cp39-cp39-macosx_11_0_arm64.whl
lipo -info _aicspylibczi.cpython-39-darwin.so  
Non-fat file: _aicspylibczi.cpython-39-darwin.so is architecture: arm64

artifact/aicspylibczi-3.0.4-cp39-cp39-macosx_10_9_universal2.whl
lipo -info _aicspylibczi.cpython-39-darwin.so
Architectures in the fat file: _aicspylibczi.cpython-39-darwin.so are: x86_64 arm64 

And the 3.8's:

artifact/aicspylibczi-3.0.4-cp38-cp38-macosx_11_0_arm64.whl
lipo -info _aicspylibczi.cpython-38-darwin.so
Non-fat file: _aicspylibczi.cpython-38-darwin.so is architecture: arm64

artifact/aicspylibczi-3.0.4-cp38-cp38-macosx_10_9_universal2.whl
lipo -info _aicspylibczi.cpython-38-darwin.so
Architectures in the fat file: _aicspylibczi.cpython-38-darwin.so are: x86_64 arm64 

And the 3.10s

artifact/aicspylibczi-3.0.4-cp310-cp310-macosx_11_0_arm64.whl
lipo -info _aicspylibczi.cpython-310-darwin.so
Non-fat file: _aicspylibczi.cpython-310-darwin.so is architecture: arm64

artifact/aicspylibczi-3.0.4-cp310-cp310-macosx_10_9_universal2.whl
lipo -info _aicspylibczi.cpython-310-darwin.so
Architectures in the fat file: _aicspylibczi.cpython-310-darwin.so are: x86_64 arm64 

Also in my 3.9 environment i tested that the artifact works correctly with aicsimageio to import .czi. No errors (just a simple file from the napari-aicsimageio test resources, I don't have any of my own .czi files)

Question:

  • why does the universal say macosx_10_9 vs. 11_0 for the arm64? Does this matter?
  • the library overall is small <1Mb so the universal2 is ~1.5Mb—does it make sense to ship the arm64 separately ? no idea how this works from the pip install side from pypi though...

@evamaxfield
Copy link
Collaborator

evamaxfield commented Feb 15, 2022

the library overall is small <1Mb so the universal2 is ~1.5Mb—does it make sense to ship the arm64 separately ? no idea how this works from the pip install side from pypi though...

I am pretty sure that we need to ship them all separately. Exciting stuff though. Seems like we have some form of working mac builds. Will ship with next release! Nice job @toloudis

@toloudis
Copy link
Collaborator

I think the macos10_9 vs 11_0 is because we are building on two different macos configs. I am assuming pypi knows how to deal with all that once we ship everything up there but I'm not really sure.

@toloudis
Copy link
Collaborator

toloudis commented Feb 15, 2022

Here is the diff if interested. Very similar to the link above. Sadly I made the mistake of doing the first push on main and so I just kept going. My fault there, and I probably should have corrected that.

https://github.com/AllenCellModeling/aicspylibczi/compare/10f5a3015d2af7fe7c6c7247b1726505329df2f8..2023346df61ede3f5c4e3b8a925e4799a783d09b

@psobolewskiPhD
Copy link

Maybe you can do a pre-release which should make testing off pypi possible?

@psobolewskiPhD
Copy link

@toloudis I saw the 3.0.5dev pre-release.
Doing pip install aicspylibczi --pre -U in my M1 macOS 12.1, arm64 python 3.9 env gave me:
.rwxr-xr-x 1.5M 16 Feb 09:35 _aicspylibczi.cpython-39-darwin.so*
and lipo shows:
Non-fat file: _aicspylibczi.cpython-39-darwin.so is architecture: arm64
🎉
So looks like pip favors non-fat or it's due to the OS version difference. Eitherway, this issue is resolved.

PS: any plan to make this available on conda-forge as well? I saw that aicsimageio is...

@toloudis
Copy link
Collaborator

Ah, glad you found it!

We should have an open issue to add this to conda-forge somewhere if it's not already.

@psobolewskiPhD
Copy link

Looks like @tlambert03 was working on it:
conda-forge/staged-recipes#16326

I'm not sure I totally understand how that all works, but at the moment it's not compiled for arm64 :

Executing the query aicspylibczi

conda-forge/osx-arm64               @   2.2MB/s  0.8s
conda-forge/noarch                  @   3.4MB/s  2.4s


No entries matching "aicspylibczi" found

@tlambert03
Copy link

yeah, needed someone with more direct interaction with aicspylibczi to pick that one up

@evamaxfield
Copy link
Collaborator

I think after our next release of this library we should be able to rerun those jobs / update the version tag on that PR and the builds "may just pass" because of these changes?

@toloudis
Copy link
Collaborator

I bumped 3.0.5 to full release. Should publish soon.

@evamaxfield
Copy link
Collaborator

evamaxfield commented Feb 16, 2022

@emay2022 @ianhi could either of you attempt to install this library now to see if we can close this one? ignore. looks like the builds failed 😢

@toloudis
Copy link
Collaborator

I don't know what is up with that manylinux curl request. It has failed before and then I re-ran it and it worked.

@toloudis
Copy link
Collaborator

should be published now

@psobolewskiPhD
Copy link

pip install aicspylibczi                                       (napari-CL) ─╯
Collecting aicspylibczi
  Downloading aicspylibczi-3.0.5-cp39-cp39-macosx_11_0_arm64.whl (657 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 657.5/657.5 KB 1.0 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.14.1 in ./Dev/miniforge3/envs/napari-CL/lib/python3.9/site-packages (from aicspylibczi) (1.22.2)
Installing collected packages: aicspylibczi
Successfully installed aicspylibczi-3.0.5
 lipo -info _aicspylibczi.cpython-39-darwin.so                  (napari-CL) ─╯
Non-fat file: _aicspylibczi.cpython-39-darwin.so is architecture: arm64

And I can load variable_scene_shape_first_scene_pyramid.czi from napari-aicsimageio test resources just fine.
🎉

@toloudis
Copy link
Collaborator

Excellent! Hopefully aicsimageio is next on the M1 train :)

@psobolewskiPhD
Copy link

Oh aicsimageio has been on the M1 train from day 1, believe me!
❤️

(LIF user here, so this was never a real issue for me personally and readlif is pure python)

@evamaxfield
Copy link
Collaborator

Once @emay2022 or @ianhi try it out on m1 mac we can close this issue. And maybe try a condaforge build (cc @tlambert03)

This checks another thing off the checklist of items for aicsimageio minor release + napari-aicsimageio minor release as well! Keep eyes out for those in next couple of days 👀

@tlambert03
Copy link

I just tried the conda build again, but no luck. Ideally, the sdist distributed here on pypi would have everything needed to build the package, but it doesn't have much at all (like the cmakelist, etc...). I think we came across this before and decided to try using tagged refs available on github. So it would be good to tag a new 3.0.5 so I can try it from github directly. But generally speaking, we can't git clone recursive a repo when building on conda forge. Ideally, they want versioned source distributions that either contain everything they need to build. So I suspect the empty libCZI folder without recursing submodules will be an issue). We can ping someone from conda forge for suggestions on how to deal with this one, but from past experience, I don't think they like little scripts that git clone things while building, since they are harder to make deterministic builds

@emay2022
Copy link
Author

I ran pip install aicspylibczi --upgrade and got:

Requirement already satisfied: aicspylibczi in /Users/Elizabeth/mambaforge/envs/micro/lib/python3.9/site-packages (3.0.4)
Collecting aicspylibczi
  Downloading aicspylibczi-3.0.5-cp39-cp39-macosx_11_0_arm64.whl (657 kB)
     |████████████████████████████████| 657 kB 3.2 MB/s            
Requirement already satisfied: numpy>=1.14.1 in /Users/Elizabeth/mambaforge/envs/micro/lib/python3.9/site-packages (from aicspylibczi) (1.22.0)
Installing collected packages: aicspylibczi
  Attempting uninstall: aicspylibczi
    Found existing installation: aicspylibczi 3.0.4
    Uninstalling aicspylibczi-3.0.4:
      Successfully uninstalled aicspylibczi-3.0.4
Successfully installed aicspylibczi-3.0.5

Then I was able to load a .czi file using out = aicspylibczi.CziFile(path) without an error.

Thank you so much everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Administrative / planning bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants