ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
21 stars 32 forks source link

How to install on M1 mac in python 3.9 environment? #324

Closed hiroalchem closed 2 years ago

hiroalchem commented 2 years ago

I tried to install it in the following way conda create -n omero -c ome python=3.9 zeroc-ice36-python omero-py I get the following error and cannot install, what should I do?

PackagesNotFoundError: The following packages are not available from current channels:

  - zeroc-ice36-python

Current channels:

  - https://conda.anaconda.org/ome/osx-arm64
  - https://conda.anaconda.org/ome/noarch
  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.
will-moore commented 2 years ago

This is probably not much help, but that command worked fine for me:

$ which conda
/Users/wmoore/opt/anaconda3/condabin/conda
$ conda --version
conda 4.10.3

$ conda create -n omero2 -c ome python=3.9 zeroc-ice36-python omero-py
...
The following NEW packages will be INSTALLED:
...
zeroc-ice36-python ome/osx-64::zeroc-ice36-python-3.6.5-py39h141701c_7
...
$ conda activate omero2
...
$ omero login      # worked OK

$ pip freeze | grep zeroc
zeroc-ice @ file:///usr/local/miniconda/conda-bld/zeroc-ice36-python_1606217156867/work

I forget how I installed conda or whether I chose Anaconda or Miniconda (both appear above) but I think it was Anaconda https://www.anaconda.com/products/individual#Downloads

manics commented 2 years ago

https://github.com/ome/conda-zeroc-ice36-python will need an osx-arm64 build to support M1 Macs

hiroalchem commented 2 years ago

@will-moore Thanks. So, as @manics pointed out, it is still an M1 mac issue and needs to be built, right? Is the conda-zeroc-ice36-python going to have an osx-arm64 build ready? Or should I build it myself? If there is a way to do this, I would be very grateful if someone could tell me how to do it.

will-moore commented 2 years ago

I don't know what @manics means. I just know that I have an M1 Mac and the commands above worked for me without having to "build" anything.

Screenshot 2022-03-25 at 10 24 43

Did you install conda via Anaconda or miniconda. I think I used Anaconda.

manics commented 2 years ago

Sorry, I think @will-moore is right, it's possible to run cross-architecture binaries, see e.g. https://towardsdatascience.com/using-conda-on-an-m1-mac-b2df5608a141

jburel commented 2 years ago

I tested it again and it works for me too on M1 The command can actually be simplified i.e. conda create -n omero -c ome python=3.9 omero-py

hiroalchem commented 2 years ago

I have not been able to get it to work yet, could it be the Rosseta environment?

jburel commented 2 years ago

I have installed Anaconda. There is also https://github.com/conda-forge/miniforge#miniforge3 (I have not tried it). What are you using?

hiroalchem commented 2 years ago

I have installed miniforge3. I am not using Rosetta, is that the reason?

conda create -n omero -c ome python=3.9 omero-py
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                     

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
python=3.9
omero-py -> python=3
omero-py -> appdirs -> python[version='>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.6',build=*_cpython]
jburel commented 2 years ago

It could be, we are also new to M1. We are using Rosetta.

hiroalchem commented 2 years ago

It worked well in the Rosetta environment. Thank you very much. However, due to other libraries, I want to run it in the M1 mac native environment. Is there any way to do this?

hiroalchem commented 2 years ago

After installing ice with brew, I installed zeroc-ice with pip and was able to install it in a native environment on M1 mac. However, in this case version 3.7.7 was installed. omero-py specifies version <3.7, is there a problem with 3.7?

jburel commented 2 years ago

There is no problem with Ice 3.7 as such. We do not support it. So unfortunately the setup using ice 3.7 won't work.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/unable-to-install-zeroc-ice-when-using-omero-py-in-m1-macs-native-environment/65311/3

will-moore commented 2 years ago

@hiroalchem You say you've been using miniforge3. Have you tried Anaconda (https://www.anaconda.com/products/individual#Downloads)?

hiroalchem commented 2 years ago

Thank you @manics, I was able to install from conda-forge.