mckinsey / causalnex

A Python library that helps data scientists to infer causation rather than observing correlation.

Home Page:http://causalnex.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Pycharm cannot use causalnex

PhilrainV opened this issue · comments

Contact Details

2644595124@qq.com

Short description of the problem here.

Pycharm encountered “ ModuleNotFoundError:No module named 'causalnex. structure'; ' Causalnex 'is not a package” while “from causalnex.structure import StructureModel“.

CausalNex Version

0.12.0

Python Version

3.8

Relevant code snippet

import warnings
from causalnex.structure import StructureModel

warnings.filterwarnings("ignore")  # silence warnings

sm = StructureModel()

Relevant log output

D:\CODE_env\Anaconda\anaconda3\envs\CSN\python.exe D:\Project\NeurIPS2024\XX\causalnex.py 
Traceback (most recent call last):
  File "D:\Project\NeurIPS2024\XX\causalnex.py", line 36, in <module>
    from causalnex.structure import StructureModel
  File "D:\Project\NeurIPS2024\XX\causalnex.py", line 36, in <module>
    from causalnex.structure import StructureModel
ModuleNotFoundError: No module named 'causalnex.structure'; 'causalnex' is not a package

Code of Conduct

  • I agree to follow this project's Code of Conduct

Your filename causalnex.py is in conflict with the Package name. Change your file to another name.