royerlab / aydin

Aydin — User-friendly, Fast, Self-Supervised Image Denoising for All.
https://royerlab.github.io/aydin/
BSD 3-Clause "New" or "Revised" License
149 stars 14 forks source link

aydin fails to install on Apple M1 #297

Open keithchev opened 1 year ago

keithchev commented 1 year ago

Describe the bug Installing aydin via pip on an Apple M1 fails because of an error installing pyqt5.

To Reproduce Obtain a 2021 Apple M1 Macbook Pro and attempt to install aydin:

conda create -y -n aydin-env python=3.
conda activate aydin-env
pip install aydin

This results in an error when installing pyqt5:

Collecting PyQt5>=5.15.6
  Using cached PyQt5-5.15.9.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

Desktop (please complete the following information): macOS Monterey (12.5) on Apple M1 (arm64)

AhmetCanSolak commented 1 year ago

Thank you @keithchev for the issue.

I was able to reproduce the error, and more. I found hacks to make PyQt5 install without issues from pypi but those solutions won't provide a pleasant install experience so I started look into other ideas, then: I observed PyQt6 is able to install without issues on M1 system. I will make an issue and a PR to investigate further what it would take for us to migrate PyQt6.

Tensorflow caused errors too but I discovered tensorflow-macos and tensorflow-metal installs on M1 MBP without issue. I am imagining these can be optional dependencies for M1 Aydin users. Also tensorflow related code is deprecated in v0.1.15, so this is a smaller concern overall.

LightGBM seem to not plan support for M1 silicon also, we can potentially make LightGBM an optional dependency as well.

scikit-image and imagecodecs also tried building from source on M1, so we would also need to address them before making Aydin supported on M1 systems.

keithchev commented 1 year ago

I noticed these problems too. I think the issue with scikit-image is that 0.18.3 requires numpy 1.19.3, which is not available for arm64 on pypi (though it is on conda-forge). I did not look into the issue with imagecodecs 2022.2.2, but fwiw I did notice that it too is installable using conda.