crytic / amarna

Amarna is a static-analyzer and linter for the Cairo programming language.
https://blog.trailofbits.com/2022/04/20/amarna-static-analysis-for-cairo-programs/
GNU Affero General Public License v3.0
149 stars 7 forks source link

Missing pydot dependency #7

Closed milancermak closed 2 years ago

milancermak commented 2 years ago

I cloned the repo and pip install -e . the package. When I tried to use the -png cmdline arg, I got the following error:

amarna contracts/settling_game/S06_Combat.cairo -png
Traceback (most recent call last):
  File "/Users/m/.pyenv/versions/starkware/bin/amarna", line 33, in <module>
    sys.exit(load_entry_point('amarna', 'console_scripts', 'amarna')())
  File "/Users/m/projects/amarna/amarna/command_line.py", line 61, in main
    results = analyze_file(filename, png=args.png)
  File "/Users/m/projects/amarna/amarna/amarna.py", line 140, in analyze_file
    return amarna.run_local_rules(fname, parsed_cairo_file, png)
  File "/Users/m/projects/amarna/amarna/amarna.py", line 73, in run_local_rules
    make_png(parsed_cairo_file, png_filename)
  File "/Users/m/projects/amarna/amarna/amarna.py", line 15, in make_png
    tree.pydot__tree_to_png(t, out_name)
  File "/Users/m/.pyenv/versions/3.9.6/envs/starkware/lib/python3.9/site-packages/lark/tree.py", line 184, in pydot__tree_to_png
    graph = pydot__tree_to_graph(tree, rankdir, **kwargs)
  File "/Users/m/.pyenv/versions/3.9.6/envs/starkware/lib/python3.9/site-packages/lark/tree.py", line 204, in pydot__tree_to_graph
    import pydot
ModuleNotFoundError: No module named 'pydot'

pip install pydot solved it

fcasal commented 2 years ago

Hey @milancermak, thanks for reporting this! I've added pydot as a dependency and it should now work when you first install it.