New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with latest version of Networkx #3

Closed
taynaud opened this Issue Jan 29, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@taynaud
Owner

taynaud commented Jan 29, 2017

networkx==2.0 implements G.edges() instead of G.edges_iter(). When would you provide a version with updated best_partition() code that will be compatible with that change?

File "/usr/local/lib/python2.7/site-packages/community/community_louvain.py", line 203, in best_partition dendo = generate_dendrogram(graph, partition, weight, resolution) File "/usr/local/lib/python2.7/site-packages/community/community_louvain.py", line 285, in generate_dendrogram current_graph = induced_graph(partition, current_graph, weight) File "/usr/local/lib/python2.7/site-packages/community/community_louvain.py", line 339, in induced_graph for node1, node2, datas in graph.edges_iter(data=True): AttributeError: 'Graph' object has no attribute 'edges_iter'

@DinosC

This comment has been minimized.

Show comment
Hide comment
@DinosC

DinosC Feb 21, 2017

Hi, is there any update? I am experiencing the same problem. Thanks

DinosC commented Feb 21, 2017

Hi, is there any update? I am experiencing the same problem. Thanks

@taynaud

This comment has been minimized.

Show comment
Hide comment
@taynaud

taynaud Feb 22, 2017

Owner

Hi, latest master is now compatible. I have not done extensive testing though, so be carefull with your results.

I'll make a release after networkx 2.0 release, but you can already install it with

pip install -U git+https://github.com/taynaud/python-louvain.git

Best

Owner

taynaud commented Feb 22, 2017

Hi, latest master is now compatible. I have not done extensive testing though, so be carefull with your results.

I'll make a release after networkx 2.0 release, but you can already install it with

pip install -U git+https://github.com/taynaud/python-louvain.git

Best

@DinosC

This comment has been minimized.

Show comment
Hide comment
@DinosC

DinosC Feb 23, 2017

DinosC commented Feb 23, 2017

@taynaud

This comment has been minimized.

Show comment
Hide comment
@taynaud

taynaud Mar 25, 2017

Owner

Work for networkx 2 is now in separate branch. Install with

pip install -U git+https://github.com/taynaud/python-louvain.git@networkx2

Owner

taynaud commented Mar 25, 2017

Work for networkx 2 is now in separate branch. Install with

pip install -U git+https://github.com/taynaud/python-louvain.git@networkx2

@taynaud

This comment has been minimized.

Show comment
Hide comment
@taynaud

taynaud Sep 21, 2017

Owner

version 0.9 handles networkx 2.0

Owner

taynaud commented Sep 21, 2017

version 0.9 handles networkx 2.0

@ColinWilder

This comment has been minimized.

Show comment
Hide comment
@ColinWilder

ColinWilder Oct 17, 2017

Had same problem, in code for doing SNA at https://programminghistorian.org/lessons/exploring-and-analyzing-network-data-with-python. @taynaud's code
pip install -U git+https://github.com/taynaud/python-louvain.git
worked for me.

ColinWilder commented Oct 17, 2017

Had same problem, in code for doing SNA at https://programminghistorian.org/lessons/exploring-and-analyzing-network-data-with-python. @taynaud's code
pip install -U git+https://github.com/taynaud/python-louvain.git
worked for me.

@taynaud

This comment has been minimized.

Show comment
Hide comment
@taynaud

taynaud Oct 17, 2017

Owner

Hello,

pip install -U python-louvain should upgrade to 0.9 which works well with networkx 2.0.

You have issue with this version and networkx 2.0 ?

Best

Owner

taynaud commented Oct 17, 2017

Hello,

pip install -U python-louvain should upgrade to 0.9 which works well with networkx 2.0.

You have issue with this version and networkx 2.0 ?

Best

@zikoalexis

This comment has been minimized.

Show comment
Hide comment
@zikoalexis

zikoalexis Feb 25, 2018

Heloo @taynaud I still have the same problem even if i have the version netwrokx=2.0 ?? Can you please help me ?

zikoalexis commented Feb 25, 2018

Heloo @taynaud I still have the same problem even if i have the version netwrokx=2.0 ?? Can you please help me ?

@taynaud

This comment has been minimized.

Show comment
Hide comment
@taynaud

taynaud Mar 5, 2018

Owner

Hello,

If you use networkx>=2.0, you need to use python-louvain>0.8 (latest is best)

If you use networkx<2.0, you need to use python-louvain==0.8

So, my advice is to use the maximal networkx version compatible with your code/dependencies and then select the python-louvain version depending on this choice.

I will add version information inside the package to allow to insure the used version, it is often difficult to now what you are using, depending on the virtual env, system... It will be tracked with #20

Owner

taynaud commented Mar 5, 2018

Hello,

If you use networkx>=2.0, you need to use python-louvain>0.8 (latest is best)

If you use networkx<2.0, you need to use python-louvain==0.8

So, my advice is to use the maximal networkx version compatible with your code/dependencies and then select the python-louvain version depending on this choice.

I will add version information inside the package to allow to insure the used version, it is often difficult to now what you are using, depending on the virtual env, system... It will be tracked with #20

@zikoalexis

This comment has been minimized.

Show comment
Hide comment
@zikoalexis

zikoalexis Mar 10, 2018

Thank you Taynaud i used the version networkx >2 and the python-louvain And it worked very well for me !!

zikoalexis commented Mar 10, 2018

Thank you Taynaud i used the version networkx >2 and the python-louvain And it worked very well for me !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment