sknetwork-team / scikit-network

Graph Algorithms
Other
606 stars 66 forks source link

module 'sknetwork.data' has no attribute 'from_edge_list' #540

Closed levrone1987 closed 2 years ago

levrone1987 commented 2 years ago

Description

On my laptop I have python 3.8, and the code that uses sknetwork works well. However, this same code does not work in another environment, which has the same sknetwork version, but different python version = 3.7.13. The error that I get is the following:

AttributeError
module 'sknetwork.data' has no attribute 'from_edge_list'

I cannot change the python version in this other environment. Please propose how I could get the code running there (perhaps a replacement for from_edge_list method).

tbonald commented 2 years ago

Hi! Python version 3.7 is no longer supported by the most recent version of sknetwork (0.27). However, it is supported by the previous version (0.26) where the from_edge_list method is available. Please make sure that the version 0.26 of sknetwork is installed on your computer with Python 3.7. Thanks!

levrone1987 commented 2 years ago

Thanks tbonald!

I managed to install scikit-network==0.26, but the error still persist:

line 249, in train_pagerank_model
    graph = skn.data.from_edge_list(train_data, bipartite=True, reindex=True, matrix_only=False)
AttributeError: module 'sknetwork.data' has no attribute 'from_edge_list'

Any thoughts?

tbonald commented 2 years ago

Hi @levrone1987 I've just checked on Google Colab (Python 3.7) and it works.

!pip install scikit-network==0.26.0 from sknetwork.data import from_edge_list graph = from_edge_list([('a', 'b')])

Please note that the documentation of the version 0.26 of scikit-network is now available. I hope it helps.

levrone1987 commented 2 years ago

There are still problems. Could you please let me know what is the new way of building a graph, such that I could replace the line

graph = skn.data.from_edge_list(train_data, bipartite=True, reindex=True, matrix_only=False)

assuming scikit-network's newest version? Thanks a lot!

tbonald commented 2 years ago

This works with the newest version of scikit-network: https://scikit-network.readthedocs.io/en/latest/reference/data.html

Please check your inputs.