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.
https://www.pywhy.org/dowhy
MIT License
6.88k stars 915 forks source link

Python 3.12 support #1167

Open r7sy opened 2 months ago

r7sy commented 2 months ago

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

yechs commented 1 month ago

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

amit-sharma commented 1 month ago

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

bloebp commented 1 month ago

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.

dimoibiehg commented 3 days ago

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.

bloebp commented 3 days ago

@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.

dimoibiehg commented 3 days ago

@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.

bloebp commented 3 days ago

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

dimoibiehg commented 3 days ago

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.

bloebp commented 3 days ago

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