'from community import community_louvain ModuleNotFoundError: No module named 'community'

before console give me this error "AttributeError: module 'community' has no attribute 'best_partition"

then, I followed these steps. ** Pipe Uninstall Community and pip install python-louvain **

I don't know why Community package was not being uninstalled(approximately I, wait half to one hour or more), then I go to the anaconda folder manually and delete the "community package".

Now the console will give me the error "ModuleNotFoundError: No module named 'community'"

Please advise me how I can solve my problem.

import networkx as nx
import community
G = nx.karate_club_graph()
louvain_partition = community.best_partition(G)
modularity = community.modularity(louvain_partition, G)
print("The modularity Q based on networkx is {}".format(modularity))
communities = louvain(G)
desity = nx.modularity_density(G,communities)
print(desity)


Solution 1:[1]

There are two solutions for this:

Switch the remote URL to use HTTPS instead of SSH (you should not have any authentication issues as long as you are logged in with your GitHub account in GitHub Desktop).

Get SSH working. The host key verification failed error means that the host key from GitHub Enterprise isn't in your known_hosts file. You should be able to fix this by running the following command from Git Bash:

ssh-keyscan -H <GitHub_URL> >> ~/.ssh/known_hosts

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bhushan Uniyal