AttributeError: module 'networkx.algorithms.community' has no attribute 'best_partition'

I think you're confusing the community module in networkx proper with the community detection in the python-louvain module which uses networkx.

If you install python-louvain, the example in its docs works for me, and generates images like

sample graph partition

Note that you'll be importing community, not networkx.algorithms.community. That is,

import community

[.. code ..]

partition = community.best_partition(G_fb)