0

I am new to python. I am trying to use 'pymnet' library for multilayer network analysis. Somehow I could work with this library, but later, when I try to import the library I fount the following error.

ImportError Traceback (most recent call last) /var/folders/61/5__nt2nn7ll4g4mwwckv8dk00000gn/T/ipykernel_2510/2101304131.py in 1 import networkx ----> 2 from pymnet.net import MultilayerNetwork

/opt/miniconda3/lib/python3.9/site-packages/pymnet/init.py in 22 pass 23 ---> 24 from . import sampling 25

ImportError: cannot import name 'sampling' from partially initialized module 'pymnet' (most likely due to a circular import) (/opt/miniconda3/lib/python3.9/site-packages/pymnet/init.py)

I use following configuration:

  1. Conda environment
  2. MacOS (m1)
  3. python 3.9.7

I am looking forward to having solution from this big community.

1 Answers1

0

I ran into this same issue and worked around it by adding "pymnet.sampling" pymnet setup.py file. So the packages line became:

packages=["pymnet", "pymnet.tests","pymnet.sampling","pymnet.visuals","pymnet.visuals.drawbackends","pymnet.isomorphisms","pymnet.graphlets"]

Then in my conda environment I reran python setup.py install and it it was able to import successfully.

pmc30
  • 16