saeyslab / napari-sparrow

Other
17 stars 0 forks source link

Error in creating conda environment with .yml #200

Closed HeesooSong closed 1 month ago

HeesooSong commented 1 month ago

Hi,

I'm trying to install sparrow with given environment.yml file in Linux server, but it gives me warning below:

$ conda env create -f environment.yml Collecting package metadata (repodata.json): \ WARNING conda.models.version:get_matcher(548): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0., but conda is ignoring the . and treating it as 1.9.0 WARNING conda.models.version:get_matcher(548): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0., but conda is ignoring the . and treating it as 1.8.0 WARNING conda.models.version:get_matcher(548): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1., but conda is ignoring the . and treating it as 1.7.1 WARNING conda.models.version:get_matcher(548): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0., but conda is ignoring the . and treating it as 1.6.0 done Solving environment: | Found conflicts! Looking for incompatible packages.

Could it be due to a different conda version? My colleague who tried sparrow could only install through mamba, not conda. Below is my conda report:

✔ [Jun/25 15:52] vsc35625@tier2-p-login-1 ~ $ conda info active environment : base active env location : /staging/leuven/stg_00080/vrc/Projects/Project_Heesoo/conda shell level : 1 user config file : /user/leuven/356/vsc35625/.condarc populated config files : /user/leuven/356/vsc35625/.condarc conda version : 23.5.0 conda-build version : 3.25.0 python version : 3.9.16.final.0 virtual packages : __archspec=1=x86_64 glibc=2.28=0 linux=4.18.0=0 __unix=0=0 base environment : /staging/leuven/stg_00080/vrc/Projects/Project_Heesoo/conda (writable) conda av data dir : /staging/leuven/stg_00080/vrc/Projects/Project_Heesoo/conda/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/bioconda/linux-64 https://conda.anaconda.org/bioconda/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /staging/leuven/stg_00080/vrc/Projects/Project_Heesoo/conda/pkgs /user/leuven/356/vsc35625/.conda/pkgs envs directories : /staging/leuven/stg_00080/vrc/Projects/Project_Heesoo/conda/envs /user/leuven/356/vsc35625/.conda/envs platform : linux-64 user-agent : conda/23.5.0 requests/2.31.0 CPython/3.9.16 Linux/4.18.0-513.24.1.el8_9.x86_64 rocky/8.9 glibc/2.28 UID:GID : 2535625:2535625 netrc file : None offline mode : False

Thank you very much!

Best, Heesoo

ArneDefauw commented 1 month ago

Hi Heesoo, thanks for opening an issue! Can you try setting libmamba as the solver:

https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community

Please let me know if this would not fix the issue

HeesooSong commented 1 month ago

Hi Arne, thanks for the suggestion. However, it raises another error shown below. I have followed the instructions from the given link: updating conda version, installing the solver, and setting it. I also found that the environment.yml content in GitHub and readdocs are different. I tried both, and they give the same error.

Channels:

  • pytorch
  • conda-forge
  • bioconda
  • defaults Platform: linux-64 Collecting package metadata (repodata.json): done Solving environment: | warning libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY ... warning libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY warning libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY failed

LibMambaUnsatisfiableError: Encountered problems while solving:

  • nothing provides libopencv 4.2.0 py36_5 needed by opencv-4.2.0-py36_5

Could not solve for environment specs The following packages are incompatible ├─ opencv is installable with the potential options │ ├─ opencv [2.4.12|2.4.13|3.1.0|3.2.0] would require │ │ └─ python 2.7 , which can be installed; │ ├─ opencv [2.4.13.4|3.2.0|3.3.0|3.4.1] would require │ │ └─ ffmpeg >=3.2.3,<3.2.6 , which conflicts with any installable versions previously reported; │ ├─ opencv 3.1.0 would require │ │ └─ python 3.4 , which can be installed; │ ├─ opencv [3.1.0|3.2.0] would require │ │ └─ python 3.5 , which can be installed; │ ├─ opencv [3.1.0|3.2.0] would require │ │ └─ python 3.6 , which can be installed; │ ├─ opencv [3.4.1|3.4.3|3.4.4|3.4.7] would require │ │ ├─ ffmpeg >=4.0.2,<4.1.0a0 , which conflicts with any installable versions previously reported; │ │ └─ libopencv 3.4.7 hc173e35_5, which requires │ │ └─ ffmpeg >=4.0.2,<4.1.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 3.4.1 would require │ │ └─ ffmpeg >=4.0.1,<4.1.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [3.4.4|3.4.7|...|4.1.1] would require │ │ ├─ ffmpeg 4.1. , which conflicts with any installable versions previously reported; │ │ └─ libopencv [3.4.7 h0cc45ee_4|4.1.1 h0cc45ee_3], which requires │ │ └─ ffmpeg 4.1. , which conflicts with any installable versions previously reported; │ ├─ opencv [3.4.7|3.4.8|...|4.2.0] would require │ │ └─ libopencv [3.4.7 h32d60f7_6|3.4.7 py27_7|...|4.2.0 py38_4], which requires │ │ └─ ffmpeg >=4.1.3,<4.2.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 4.2.0 would require │ │ └─ libopencv 4.2.0 py36_5, which does not exist (perhaps a missing channel); │ ├─ opencv [4.2.0|4.3.0|4.4.0] would require │ │ └─ py-opencv [4.2.0 py36h0b673f9_6|4.3.0 py36h0b673f9_2|4.4.0 py36h0b673f9_2], which requires │ │ └─ python_abi 3.6 _pypy36_pp73, which requires │ │ └─ python 3.6. _73_pypy, which can be installed; │ ├─ opencv [4.2.0|4.3.0] would require │ │ └─ libopencv [4.2.0 py36_7|4.2.0 py37_7|...|4.3.0 py38_1], which requires │ │ └─ ffmpeg >=4.2.3,<4.3.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [4.2.0|4.3.0|4.4.0] would require │ │ └─ py-opencv [4.2.0 py37h43977f1_5|4.2.0 py37h43977f1_6|4.3.0 py37h43977f1_2|4.4.0 py37h43977f1_2], which requires │ │ ├─ python >=3.7,<3.8.0a0 , which can be installed; │ │ └─ python_abi 3.7. _cp37m, which can be installed; │ ├─ opencv [4.2.0|4.3.0|4.4.0] would require │ │ └─ py-opencv [4.2.0 py38h23f93f0_5|4.2.0 py38h23f93f0_6|4.3.0 py38h23f93f0_2|4.4.0 py38h23f93f0_2], which requires │ │ ├─ python >=3.8,<3.9.0a0 , which can be installed; │ │ └─ python_abi 3.8. *_cp38, which can be installed; │ ├─ opencv [4.4.0|4.5.0|4.5.1|4.5.2] would require │ │ └─ libopencv [4.4.0 py36_3|4.4.0 py37_3|...|4.5.2 py39h70bf20d_1], which requires │ │ └─ ffmpeg >=4.3.1,<4.4.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 4.5.0 would require │ │ └─ libopencv 4.5.0 py36_5, which does not exist (perhaps a missing channel); │ ├─ opencv 4.5.0 would require │ │ └─ libopencv 4.5.0 py36_6, which does not exist (perhaps a missing channel); │ ├─ opencv [4.5.3|4.5.5] would require │ │ └─ libopencv [4.5.3 py31hbd5a65a_6|4.5.3 py31he7a5e20_7|...|4.5.5 py39hfb30bf4_6], which requires │ │ └─ ffmpeg >=4.3.2,<4.4.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 4.5.5 would require │ │ └─ libopencv [4.5.5 py310h1897127_9|4.5.5 py310hc83fb77_10|...|4.5.5 py39he64e9e9_10], which requires │ │ └─ ffmpeg >=4.4.1,<5.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [4.5.3|4.5.5|4.6.0] would require │ │ └─ libopencv [4.5.3 py310hc72b5f5_8|4.5.3 py38hc6b509d_8|...|4.6.0 py39hf4bb9d8_2], which requires │ │ └─ ffmpeg >=4.4.2,<5.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [4.6.0|4.7.0] would require │ │ └─ libopencv [4.6.0 py310h5bd1119_9|4.6.0 py310h6214075_5|...|4.7.0 py39hf99ad11_5], which requires │ │ └─ ffmpeg >=5.1.2,<6.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [4.10.0|4.9.0] would require │ │ └─ libopencv [4.10.0 headless_py310h3d4b477_1|4.10.0 headless_py310hef7d0a5_0|...|4.9.0 qt6_py39hed63795_614], which requires │ │ └─ ffmpeg >=6.1.1,<7.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 4.10.0 would require │ │ └─ libopencv [4.10.0 headless_py39h4ebaf0d_1|4.10.0 headless_py39h7137bbe_0|...|4.10.0 qt6_py39ha1d3367_601], which requires │ │ └─ ffmpeg >=7.0.1,<8.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv [4.7.0|4.8.0|4.8.1] would require │ │ └─ libopencv [4.7.0 py310h245f934_4|4.7.0 py310h3e876cf_5|...|4.8.1 py39hf605482_5], which requires │ │ └─ ffmpeg >=6.0.0,<7.0a0 , which conflicts with any installable versions previously reported; │ ├─ opencv 4.9.0 would require │ │ └─ libopencv [4.9.0 headless_py310hae237af_14|4.9.0 headless_py38h0f7b093_14|...|4.9.0 qt6_py39h067c833_615], which requires │ │ └─ ffmpeg >=7.0.0,<8.0a0 , which conflicts with any installable versions previously reported; │ └─ opencv [3.3.1|3.4.1|...|4.6.0] conflicts with any installable versions previously reported; └─ python 3.10.8** is not installable because it conflicts with any installable versions previously reported.

ArneDefauw commented 1 month ago

There seems to be a problem with the installation of opencv. On what linux distribution are you? Ubuntu? Can you try removing open-cv from the environment.yml? And see if you could build your environment in that case?

If you can build the environment, you can then try


conda activate napari-sparrow
pip install git+https://github.com/saeyslab/napari-sparrow.git

the latter command will then take care of installing open-cv via pip

HeesooSong commented 1 month ago

I solved this issue by changing channel priority to "flexible" instead of "strict"!

$ cat ~/.condarc
$ conda config --get
$ conda config --set channel_priority flexible

The link below helped me figure this out: https://forum.spinalcordmri.org/t/installation-of-sct-v6-2-failed/1248/5

Hope this helps future installers :)

ArneDefauw commented 1 month ago

Hi, thanks for sharing!

Would you be so kind to share with me the content of .condarc, i.e.: nano ~/.condarc

HeesooSong commented 1 month ago

$ cat ~/.condarc channels: -- conda-forge -- bioconda -- defaults channel_priority: flexible solver: libmamba

Here it is! You can see channel_priority is "flexible" now.

ArneDefauw commented 1 month ago

ah, because of the bioconda in your.condarc. That's why I could not reproduce the issue. I will add it to the docs, thanks for sharing!