py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.

Home Page:https://www.pywhy.org/dowhy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python 3.12 support

r7sy opened this issue · comments

Is your feature request related to a problem? Please describe.
Would like to use dowhy in a Python 3.12 project.

Describe the solution you'd like

  • Python 3.12 support

Running from dowhy import gcm results in the following error in Python 3.12:

ModuleNotFoundError: No module named 'numpy.distutils'

Likely caused by numpy.distutils's removal in Python >= 3.12.
See https://numpy.org/doc/stable/reference/distutils_status_migration.html

@bloebp can you take a look? We can aim to do a release that supports 3.12

Some of the requirements are (or were) not supporting Python 3.12, that's why we excluded it in the last release. However, that might have changed in the mean time and should be checked again. We can certainly aim at a new release and also deprecate 3.8 support.

commented

Is your feature request related to a problem? Please describe. Would like to use dowhy in a Python 3.12 project.

Describe the solution you'd like

  • Python 3.12 support

There is also another error for me when try do the same:

ModuleNotFoundError: No module named 'numpy.dual'

I also found that my case has been reported as a bug in issue #1181.

@dimoibiehg can you double check the installed DoWhy version (e.g., print(dowhy.__version__)). This dual issue has been solved in a later version, I suspect you have 0.8 installed.

commented

@dimoibiehg can you double check the installed DoWhy version (e.g., print(dowhy.__version__)). This dual issue has been solved in a later version, I suspect you have 0.8 installed.

The result of this command is 0.8.

The current version is 0.11.1, maybe try updating DoWhy. Note that you need a Python version below 3.12, so, e.g., 3.11

commented

The current version is 0.11.1, maybe try updating DoWhy. Note that you need a Python version below 3.12, so, e.g., 3.11

Thanks for the suggestion. However, I reported the error in this issue. What I meant is that when using Python 3.12, you will get this error as well.

Ah, ok you just wanted to confirm that you have the same issue with 3.12.

Yes, we will try to address this with the next 0.12 release to be compatible with 3.12