mnets / pymnet

The original library for analyzing multilayer networks.
https://mnets.github.io/pymnet/
GNU General Public License v3.0
118 stars 24 forks source link

collections.MutableMapping removed in Python 3.10, causing error on import #11

Closed ercco closed 1 year ago

ercco commented 1 year ago

On Python 3.10.8:

>>> import pymnet as pn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Multilayer-networks-library/pymnet/__init__.py", line 1, in <module>
    from .net import MultilayerNetwork,MultiplexNetwork
  File "Multilayer-networks-library/pymnet/net.py", line 810, in <module>
    class MultiplexIntraNetDict(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'

Related: https://stackoverflow.com/questions/59636631/importerror-cannot-import-name-mutablemapping-from-collections Looks like MutableMapping has been moved from collections to collections.abc.

Temporary fix found in the StackOverflow answer: https://stackoverflow.com/a/75382123

ercco commented 1 year ago

Solved by commit bfabb6198b1a8435c3d9bf13adf55e3c1e99acc0