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

conda install issue #379

Closed brendanofallon closed 5 months ago

brendanofallon commented 1 year ago

HI there, I'm running into a strange issue trying to install omero-py via conda on RHEL 9 and Ubuntu 20.04. But the install command recommended in the documentation never works, for instance:

$ conda install -c conda-forge omero-py

Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): \ Killed

The OS always kills the conda install process midway through the install, and looks like the conda process is allocating way too much memory (just eyeballing memory usage on top, it increases rapidly while the command is running, until the OS finally just kills it). This happens repeatedly, every time I try that command, on both distros above. I'm not really sure if this is an omero-py issue, but conda appears to function normally for other packages I've tried to installed. My conda version is 23.5.2

Notably, installing from the bioconda channel (conda install -c bioconda omero-py) works fine, except that version appears to be older and requires libssl1.0, which is no longer supported (or even available) on RHEL 9. Let me know if I can provide any more info

manics commented 1 year ago

Are you using Python 3.11 by any chance? zeroc-ice 3.6 isn't available for 3.11 https://github.com/ome/omero-py/issues/360#issuecomment-1653971055 conda won't downgrade core packages like Python by default, instead it gets into a spiral of incompatible nested dependencies.

brendanofallon commented 1 year ago

Hi, I'm using python 3.8.17 - but I just figured out that the omero-py from the 'ome' conda channel installs just fine with no issues (whew!). So to sum up: installing using the conda-forge channel runs into a weird conda issue and breaks, using the bioconda channel has a version which requires a pretty old libssl1.0 which isn't available on some newer linux distros, but the one from the ome channel worked just fine with no issues. The documentation at https://omero.readthedocs.io/en/stable/users/cli/installation.html recommends conda-forge. So maybe this is just a matter of standardizing the packages from different channels and updating the docs

jburel commented 1 year ago

Did you follow the notes from the README i.e.

conda create -n myenv -c ome python=3.8 zeroc-ice36-python
conda activate myenv
conda install -c conda-forge omero-py
DrKenHo-crick commented 1 year ago

Using CenOS 7 - the recommend install above and on README just doesn't work.

The above install method gives me error when I import omero. ImportError: /home/ho/.local/lib/python3.8/site-packages/IcePy.cpython-38-x86_64-li│ nux-gnu.so: undefined symbol: sk_pop

I think it is to do with SSL version?

DrKenHo-crick commented 1 year ago

Using a docker container running Centos7

$docker run -it centos:7 /bin/bash
[root@65f202abd498 /]#  yum update -y
[root@65f202abd498 /]#  yum upgrade -y
[root@65f202abd498 /]#  yum install wget -y
[root@65f202abd498 /]#  wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
[root@65f202abd498 /]#  bash Anaconda3-2021.05-Linux-x86_64.sh
[root@65f202abd498 ~]# source ~/.bashrc
(base) [root@65f202abd498 ~]#  conda create -n omeropy -c ome python=3.8 zeroc-ice36-python
(base) [root@65f202abd498 ~]#  conda activate omeropy
(omeropy) [root@65f202abd498 ~]# conda install -c conda-forge omero-py
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: - failed with initial frozen solve. Retrying with flexible solve.

CondaError: KeyboardInterrupt

(omeropy) [root@65f202abd498 ~]# conda install -c ome omero-py
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(omeropy) [root@65f202abd498 ~]# python
Python 3.8.18 (default, Sep 11 2023, 13:20:55)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omero
>>>

It seems that using -c conda-forge failed. Was it becasuse of the older conda that I used? ==> WARNING: A newer version of conda exists. <== current version: 4.10.1 latest version: 23.7.4{

jburel commented 1 year ago

Thanks for the report The conda-forge channel will fail when attempting to install Ice will fail. It will install newer version of Ice (3.7) I will check the conda-forge channel for omero-py

DrKenHo-crick commented 1 year ago

My earlier report is based on running on our cluster using slurm/srun. It still gives me the error and it seems to be different from centos:7 install.

jburel commented 1 year ago

I have started to use mamba instead of Conda. I found it much faster and if failure easier to find the source of the problem

DrKenHo-crick commented 1 year ago

Oh, thanks for the tip. I shall try mamba. I have also sorted out the error. It was to do with sys path on Python. It actually search the module and uses a locally installed ice.py and not using the newly created conda env. By using python sys.remove the search path, the module load ok.

will-moore commented 10 months ago

When installing as per the instructions, I find that the Collecting package metadata step takes over 10 mins.

$ conda create -n omeropy38 -c ome python=3.8 zeroc-ice36-python
$ conda activate omeropy38
$ conda install -c conda-forge omero-py
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
...

However, using pip install omero-py works much faster in a conda environment created the same way.

psobolewskiPhD commented 7 months ago

Why does the README here still use -c ome for zeroc-ice given the deprecation message here: https://github.com/ome/conda-zeroc-ice36-python

Using libmamba-solver (the default in conda now since Nov 2023 https://conda.org/blog/2023-11-06-conda-23-10-0-release): mamba create --name omero-py -c conda-forge python=3.8 omero-py installs in 19 s on my arm64 Mac.

joshmoore commented 7 months ago

@brendanofallon: is this now working for you?

Why does the README here still use -c ome for zeroc-ice given the deprecation message here:

Just an oversight, @psobolewskiPhD: https://github.com/ome/omero-py/pull/397

jburel commented 5 months ago

Fixed in https://github.com/ome/omero-py/pull/407