Skip to content

No module named 'idtxl.knn' #111

@djhavert

Description

@djhavert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions