GispoCoding / eis_toolkit

Python library for mineral prospectivity mapping
https://eis-he.eu/
European Union Public License 1.2
19 stars 7 forks source link

Issues with Conda package #383

Open nmaarnio opened 5 months ago

nmaarnio commented 5 months ago

Some Windows users have reportedly been unable to install EIS Toolkit from conda-forge due to Tensorflow installation failing. In some cases, the solving has not finished succesfully and resulted in the following message without any list of the incompatible packages: UnsatisfiableError: The following specifications were found to be incompatible with each other:

If any other issues with the Conda package are found, they should be reported here. Also, this thread can be used to discuss the possible solutions to these issues.

nialov commented 5 months ago

There is an issue running the tests during the conda-forge ci, which is responsible for releasing new versions of eis_toolkit to conda-forge:

https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/924473/logs/10

ImportError: cannot import name 'inf' from 'scipy' ($PREFIX/lib/python3.10/site-packages/scipy/__init__.py)

Looks to be a dependency/version/etc. issue. Taking a look now...

nialov commented 5 months ago

Some Windows users have reportedly been unable to install EIS Toolkit from conda-forge due to Tensorflow installation failing. In some cases, the solving has not finished succesfully and resulted in the following message without any list of the incompatible packages: UnsatisfiableError: The following specifications were found to be incompatible with each other:

Do you know if these install issues are with the conda dependency solver or with mamba solver, which is more modern and works a lot better? I think mamba is being set as default in newer conda versions so this issue might not be related to that but good to ask anyway.

nmaarnio commented 5 months ago

I don't know unfortunately. Maybe @jtpesone , @chudasama-bijal or @Storch22 could comment?

I think I got that same Scipy error in my Poetry env at some point. I solved it by setting Scipy = "1.11.4" locally..

nialov commented 5 months ago

I think I got that same Scipy error in my Poetry env at some point. I solved it by setting Scipy = "1.11.4" locally..

I am currently testing if we can force libpysal to be new enough. I believe this commit fixes this issue there: https://github.com/pysal/libpysal/commit/6229b62d4434a54682308f22a49bfe9dbaa14c59

If it does not work, I will try locking scipy, thanks for letting me know!

nialov commented 5 months ago

Looks like quite the dependency mess on Windows. One problems is that dependency solving can not be tested in the feedstock repository CI due to e.g. tensorflow not being available through conda-forge channel and only through Anaconda which can not be accessed during the CI. Fun.

Dependency solving fails on Windows with these kinds of error messages:

Could not solve for environment specs
Encountered problems while solving:
  - package eis_toolkit-0.5.0-pyhd8ed1ab_0 requires rasterio >=1.3.0,<2.0.0, but none of the providers can be installed

The environment can't be solved, aborting the operation

which are not helpful as e.g. rasterio IS available but some of the dependencies of it are not and trying to find the underlying cause locally is slow. I will update on the issue here if I find a solution.

Underlying cause for these kinds of issues is the amount of dependencies eis_toolkit has. My guess is that these sort of issues will keep popping up sadly.

nmaarnio commented 4 months ago

Thanks for investigating this. It would be good if Windows user could install EIS Toolkit from conda-forge, but since I have understood that installing from PyPI works if GDAL is installed separately, there is luckily still a way to get EIS Toolkit installed.

nialov commented 4 months ago

I enabled Windows builds now on CI so it is actually possible to reliably debug the dependencies. Will report back if I can resolve them.

https://github.com/conda-forge/eis_toolkit-feedstock/pull/5

nialov commented 4 months ago

Problem of dependency conflict between GDAL and tensorflow. Both want icu package, but the versions conflict.

GDAL:

2024-05-20T08:25:01.9463869Z \u2502  \u251c\u2500 gdal [3.4.3|3.5.0] would require
2024-05-20T08:25:01.9464619Z \u2502  \u2502  \u2514\u2500 libgdal [3.4.3 h2040a12_0|3.4.3 hb47f0b7_0|...|3.5.0 hba1fd4b_1], which requires
2024-05-20T08:25:01.9465168Z \u2502  \u2502     \u2514\u2500 icu >=69.1,<70.0a0 , which can be installed;

tensorflow:

2024-05-20T08:25:01.9592585Z    \u2514\u2500 tensorflow 2.9.1 would require
2024-05-20T08:25:01.9593431Z       \u2514\u2500 tensorflow-base [2.9.1 eigen_py310he3c91d7_0|2.9.1 eigen_py310he3c91d7_1|...|2.9.1 mkl_py39h6a7f48e_1], which requires
2024-05-20T08:25:01.9594051Z          \u251c\u2500 icu >=58.2,<59.0a0 , which conflicts with any installable versions previously reported;
nialov commented 4 months ago

Installation through conda-forge on Windows should work again. E.g.

conda create -n eis_toolkit-conda-forge
conda install -n eis_toolkit-conda-forge eis_toolkit pytest
nialov commented 4 months ago

Created a pull request to better document the installation: https://github.com/GispoCoding/eis_toolkit/pull/400

nmaarnio commented 4 months ago

Closing this issue as installation problems seem to be resolved for now.

Storch22 commented 4 months ago

Hi, finally I was able to test the conda installation of the toolkit - did not work unfortunatelly. I have Windows 11 and Anaconda installed. I tried this way:

conda create -n eis_toolkit_condaforge python=3.10.11
conda activate eis_toolkit_condaforge
conda install -c conda-forge eis_toolkit --no-channel-priority

grafik

nialov commented 4 months ago

grafik

conda really does not like to give informative error messages 😄. You @Storch22 might be using the old dependency solver, i.e. you have an older version of conda installed, you can try the following command for the install:

conda install -c conda-forge eis_toolkit --no-channel-priority --solver libmamba

If you get an error message with missing libmamba solver, you can install it to the base environment with

conda install -n base conda-libmamba-solver

If you get the same error message it means the solver is not the problem.

Storch22 commented 4 months ago

Hi,

Finally it worked out when using python=3.9 instead of 3.10 and using the suggested libmamba solver.

Thank you!

Von: Nikolas Ovaskainen @.> Gesendet: Freitag, 31. Mai 2024 15:48 An: GispoCoding/eis_toolkit @.> Cc: Ina Storch @.>; Mention @.> Betreff: Re: [GispoCoding/eis_toolkit] Issues with Conda package (Issue #383)

[grafik]https://private-user-images.githubusercontent.com/98956042/335542546-8181f9c0-3db1-42f8-acdd-58b432fa0cb4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcxNjMyMzksIm5iZiI6MTcxNzE2MjkzOSwicGF0aCI6Ii85ODk1NjA0Mi8zMzU1NDI1NDYtODE4MWY5YzAtM2RiMS00MmY4LWFjZGQtNThiNDMyZmEwY2I0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTMxVDEzNDIxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhY2MzNjcxYjZkYmFiMDFiYjJlNTk0MzI0ZDJlYWQ5ZWNhMWMyYmIwMmQ4MmYxNTg0YjM3YmFlYjM1NjA0MDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KliWBoDE-mnnh_mY5c_anu-lQXCQsWIaX-k8hMR0Uzo

conda really does not like to give informative error messages 😄. You @Storch22https://github.com/Storch22 might be using the old dependency solver, i.e. you have an older version of conda installed, you can try the following command for the install:

conda install -c conda-forge eis_toolkit --no-channel-priority --solver libmamba

If you get an error message with missing libmamba solver, you can install it to the base environment with

conda install -n base conda-libmamba-solver

If you get the same error message it means the solver is not the problem.

— Reply to this email directly, view it on GitHubhttps://github.com/GispoCoding/eis_toolkit/issues/383#issuecomment-2142204626, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXS7GCRQ2KYBKKKHRU5ZXDLZFB5SRAVCNFSM6AAAAABG72KNROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBSGIYDINRSGY. You are receiving this because you were mentioned.Message ID: @.**@.>>