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
7.01k stars 922 forks source link

Update to latest version without GCM module #942

Closed SimuPig closed 1 year ago

SimuPig commented 1 year ago

Ask your question Why there is still no GCM module after dowhy upgrade to 0.9.1

Expected behavior My original Python version is 3.6.6, and the version of dowhy is 0.8. I updated it to use GCMmodule, but when I update the Python version to 3.10, dowhy becomes 0.9.1 and there is still no gcm. So what should i do to get gcm module.

Version information:

Additional context AttributeError Traceback (most recent call last)

in 1 import networkx as nx 2 import pandas as pd ----> 3 from dowhy import gcm 4 5 causal_graph = nx.DiGraph([('Page Views', 'Sold Units'), d:\python\lib\site-packages\dowhy\gcm\__init__.py in 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 d:\python\lib\site-packages\dowhy\gcm\influence.py in 12 from numpy.matlib import repmat 13 ---> 14 import dowhy.gcm.auto as auto 15 from dowhy.gcm._noise import noise_samples_of_ancestors, compute_data_from_noise 16 from dowhy.gcm.cms import ProbabilisticCausalModel, StructuralCausalModel AttributeError: module 'dowhy' has no attribute 'gcm'
bloebp commented 1 year ago

Hi, it seems the local version is still an older one. Can you try the following:

import dowhy

print(dowhy.__version__)

and double check the installed version?

SimuPig commented 1 year ago

Thank you, I finally finally finally solved this problem!!!It turns out that this is why I can use GCM with Visual Studio code, but not when I want to use jupyter :)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 7 days since being marked as stale.