Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy.dual is dropped but it still occurs in dowhy #1181

Open
wyycommu opened this issue May 14, 2024 · 2 comments
Open

numpy.dual is dropped but it still occurs in dowhy #1181

wyycommu opened this issue May 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wyycommu
Copy link

wyycommu commented May 14, 2024

When operating from dowhy import gcm, it reported: No module named 'numpy.dual'.

Details are below:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[26], line 1
----> 1 from dowhy import gcm

File d:\\PycharmProjects\\pythonProjectTest\\.venv\\Lib\\site-packages\\dowhy\\gcm\\__init__.py:12
     10 from .fitting_sampling import fit, draw_samples
     11 from .graph import StochasticModel, ConditionalStochasticModel, FunctionalCausalModel, DirectedGraph, is_root_node
---> 12 from .influence import arrow_strength, intrinsic_causal_influence
     13 from .stochastic_models import EmpiricalDistribution, BayesianGaussianMixtureDistribution, ScipyDistribution
     14 from .whatif import interventional_samples, counterfactual_samples, average_causal_effect

File d:\\PycharmProjects\\pythonProjectTest\\.venv\\Lib\\site-packages\\dowhy\\gcm\\influence.py:25
     23 from dowhy.gcm.shapley import ShapleyConfig, estimate_shapley_values
     24 from dowhy.gcm.stats import marginal_expectation
---> 25 from dowhy.gcm.uncertainty import estimate_entropy_of_probabilities, estimate_variance
     26 from dowhy.gcm.util.general import shape_into_2d, set_random_seed, is_categorical
     28 _logger = logging.getLogger(__name__)

File d:\\PycharmProjects\\pythonProjectTest\\.venv\\Lib\\site-packages\\dowhy\\gcm\\uncertainty.py:7
      1 \"\"\"Functions to estimate uncertainties such as entropy, KL divergence etc.
      2 
      3 Functions in this module should be considered experimental, meaning there might be breaking API changes in the future.
      4 \"\"\"
      6 import numpy as np
----> 7 from numpy.dual import det
      8 from scipy.special import digamma
      9 from scipy.stats import entropy

ModuleNotFoundError: No module named 'numpy.dual'"

numpy.dual is dropped from numpy since 1.20.0(https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecation-of-numpy-dual)


dowhy version: 0.8

@wyycommu wyycommu added the bug Something isn't working label May 14, 2024
@bloebp
Copy link
Member

bloebp commented May 14, 2024

Hi, can you try to update your DoWhy version? nump.dual is not used anymore in the newer DoWhy versions. The current version is 0.11.1.

@wyycommu
Copy link
Author

My python version is not compatible, it installs dowhy 0.8. After changing py3.12 to py3.11, I can install latest dowhy. Thanks for your suggestion, it helps a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants