28mm / blast-radius

Interactive visualizations of Terraform dependency graphs using d3.js
https://28mm.github.io/blast-radius-docs/
MIT License
2.03k stars 256 forks source link

AttributeError: module 'collections' has no attribute 'MutableSet' #110

Closed kokizzu closed 12 months ago

kokizzu commented 1 year ago

got this error when running:

run:

blast-radius --serve .
Traceback (most recent call last):
  File "/home/kyz/.local/bin/blast-radius", line 14, in <module>
    from blastradius.handlers.dot import DotGraph, Format, DotNode
  File "/home/kyz/.local/lib/python3.10/site-packages/blastradius/handlers/dot.py", line 12, in <module>
    from blastradius.graph import Graph, Node, Edge
  File "/home/kyz/.local/lib/python3.10/site-packages/blastradius/graph.py", line 11, in <module>
    from blastradius.util import Counter
  File "/home/kyz/.local/lib/python3.10/site-packages/blastradius/util.py", line 65, in <module>
    class OrderedSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

install:

pip3 install blastradius
Defaulting to user installation because normal site-packages is not writeable
Collecting blastradius
  Downloading BlastRadius-0.1.23.tar.gz (587 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.3/587.3 KB 3.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: BeautifulSoup4 in /usr/lib/python3/dist-packages (from blastradius) (4.10.0)
Requirement already satisfied: Flask in /home/kyz/.local/lib/python3.10/site-packages (from blastradius) (2.2.2)
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from blastradius) (3.0.3)
Collecting pyhcl>=0.3.10
  Downloading pyhcl-0.4.4.tar.gz (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.1/61.1 KB 4.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from blastradius) (2.25.1)
Requirement already satisfied: Werkzeug>=2.2.2 in /home/kyz/.local/lib/python3.10/site-packages (from Flask->blastradius) (2.2.2)
Requirement already satisfied: click>=8.0 in /usr/lib/python3/dist-packages (from Flask->blastradius) (8.1.3)
Requirement already satisfied: itsdangerous>=2.0 in /usr/lib/python3/dist-packages (from Flask->blastradius) (2.1.0)
Requirement already satisfied: MarkupSafe>=2.1.1 in /home/kyz/.local/lib/python3.10/site-packages (from Werkzeug>=2.2.2->Flask->blastradius) (2.1.2)
Building wheels for collected packages: blastradius, pyhcl
  Building wheel for blastradius (setup.py) ... done
  Created wheel for blastradius: filename=BlastRadius-0.1.23-py3-none-any.whl size=590505 sha256=75e6e0ee579669bf6513368b45e104b328abf963e6f1778bd64c71ba35f70730
  Stored in directory: /home/kyz/.cache/pip/wheels/27/c1/1e/60616aaa41dc2650f2ae6fc6d041de2d2c157de1080f134142
  Building wheel for pyhcl (pyproject.toml) ... done
  Created wheel for pyhcl: filename=pyhcl-0.4.4-py3-none-any.whl size=50147 sha256=e8db5cfcfec6e9d25d25ff22f4882bd5b6c3e84ce0f351d3860dc01843cad584
  Stored in directory: /home/kyz/.cache/pip/wheels/6c/ad/33/e11e917cf04cb1533cab6e7aaa8cee93c950aa82c32398b83e
Successfully built blastradius pyhcl
Installing collected packages: pyhcl, blastradius
Successfully installed blastradius-0.1.23 pyhcl-0.4.4

OS: Pop!_OS 22.04 Python: 3.10.6

barddes commented 12 months ago

As explained here, newer versions of python collections have no more MutableSet. Using python 3.7 fixed this issue for me