I encountered the following error in Python3.9 environment.
NetworkX: 'import networkx' fails: TypeError: entry_points() got an unexpected keyword argument 'group'
This error seems to be caused by the fact that NetworkX v3.3 does not support Python v3.9 (for your information https://github.com/networkx/networkx/pull/7028 )
A simple way to fix this is to suppress the NetworkX version below v3.2.*. For example, you add the following line into a requirement.txt and setup.py if you needed.
+ networkx==3.2.*