pwollstadt / IDTxl

The Information Dynamics Toolkit xl (IDTxl) is a comprehensive software package for efficient inference of networks and their node dynamics from multivariate time series data using information theory.
http://pwollstadt.github.io/IDTxl/
GNU General Public License v3.0
237 stars 75 forks source link

No module named 'idtxl.knn' #111

Open djhavert opened 2 months ago

djhavert commented 2 months ago

Issue Description

Looking through commits, it seems sometime in the last several months a directory knn was added to the primary idtxl directory, but the setup.py script was not altered to reflect this.

Error Message

This results in the following error

File "/home/user/.local/lib/python3.10/site-packages/idtxl/estimators_python.py", line 6, in <module>
    from idtxl.knn.knn_finder_factory import get_knn_finder
ModuleNotFoundError: No module named 'idtxl.knn'

Possible Solution(s)

One possible fix for this is to add idtxl.knn to the package list in setup.py:

...
setup(
    name="idtxl",
    packages=["idtxl", "idtxl.knn"],
    include_package_data=True,
...

I've tried the above fix locally and it seems to solve the issue.

A more general solution and further details can be found in the following thread: https://stackoverflow.com/questions/68047686/subfolder-in-python-package-not-visible-when-installed

blexo commented 1 month ago

thanks @djhavert - I was going to report this as an issue... you actually reported it And fixed it.