mckinsey / causalnex

A Python library that helps data scientists to infer causation rather than observing correlation.
http://causalnex.readthedocs.io/
Other
2.19k stars 255 forks source link

Can't install causalnex using poetry on new Apple M1 chip #188

Open achuinar opened 1 year ago

achuinar commented 1 year ago

Description

Trying to install causalnex on new M1 chip using poetry generates the following issue:

Because causalnex (0.11.0) depends on scikit-learn (>=0.22.0,<0.22.2.post1 || >0.22.2.post1,<0.24.1 || >0.24.1,<0.25.0)
 and no versions of causalnex match >0.11.0,<0.12.0, causalnex (>=0.11.0,<0.12.0) requires scikit-learn (>=0.22.0,<0.22.2.post1 || >0.22.2.post1,<0.24.1 || >0.24.1,<0.25.0).
So, because your package depends on both scikit-learn (^1.1.3) and causalnex (^0.11.0), version solving failed.

Unfortunately downgrading the version of scikit-learn generates a numpy compatibility error.

  ImportError: numpy is not installed.
        scikit-learn requires numpy >= 1.11.0.
        Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html

Context

I migrated to a new computer that has the Apple M1 chip

Steps to Reproduce

  1. Setting up python environment (in my case: 3.8.15)
  2. Installing poetry globally (installation guide)
  3. Run poetry add causalnex to resolve package dependency and install causalnex

Expected Result

I was expecting causalnex to be compatible with at least scikit-learn 1.1.3

Actual Result

I can't install causalnex.

-- If you received an error, place it here.

poetry add causalnex

Because causalnex (0.11.0) depends on scikit-learn (>=0.22.0,<0.22.2.post1 || >0.22.2.post1,<0.24.1 || >0.24.1,<0.25.0)
 and no versions of causalnex match >0.11.0,<0.12.0, causalnex (>=0.11.0,<0.12.0) requires scikit-learn (>=0.22.0,<0.22.2.post1 || >0.22.2.post1,<0.24.1 || >0.24.1,<0.25.0).
So, because your package depends on both scikit-learn (^1.1.3) and causalnex (^0.11.0), version solving failed.

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

zzzzzzzzzzzzz commented 1 year ago

Hi @achuinar

Apologize for a late response. Indeed, version 0.11.0 didn’t support sklearn 1+. However, starting from the version 0.11.2 we’ve added support of sklearn 1+. Also, you may consider using 0.12.0. I just tested it with python 3.8.15 and poetry. For my setup scikit-learn of version 1.2.2 installed.