alendit / sphinx-pyreverse

Simple sphinx wrapper around pyreverse (from pylint suit) to generate UML diagramms from modules.
GNU General Public License v3.0
50 stars 20 forks source link

FileNotFoundError exception raised after "Format: "png" not recognized. Use one of:" #24

Closed dmyersturnbull closed 3 years ago

dmyersturnbull commented 3 years ago

Failed on build. Python 3.9.1 on Windows 10.

extensions = [
    "autoapi.extension",
    "sphinx.ext.napoleon",
    "sphinx_copybutton",
    "sphinxcontrib.mermaid",
    "sphinx_rtd_theme",
    "sphinx_pyreverse",
]
sphinx-build -b html docs docs/html
updating environment: [extensions changed ('sphinx_pyreverse')] 69 added, 0 changed, 0 removed
sphinx-pyreverse: Running: pyreverse --output png --project mandos mandos
Format: "png" not recognized. Use one of:
Format: "png" not recognized. Use one of:

Exception occurred:
  File "C:\tools\miniconda3\envs\mandos2\lib\site-packages\PIL\Image.py", line 2904, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\douglas\\Desktop\\code\\mandos\\docs\\uml_images\\classes_mandos.png'
The full traceback has been saved in C:\Users\douglas\AppData\Local\Temp\sphinx-err-nts0rkuf.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
doublethefish commented 3 years ago

Do you get the same error if you run the pyreverse command on its own?

pyreverse --output png --project mandos mandos

doublethefish commented 3 years ago

Format: "png" not recognized. Use one of: Format: "png" not recognized. Use one of:

These parts of your log would list several file types if GraphViz was configured/installed properly. Looking into it a bit more it would appear this is common on windows.

stack overflow has solutions for fixing & configuring graphviz.

But, you might get better mileage with PlantUML instead, which is almost as good as using pyreverse. Based on their docs they appear to work out-of-the-box on Windows - although you might need to install PlantUML as a sidecar, instead of GraphViz, so choose your poison.

Closing, but feel free to either reopen or make a PR with an improvement on how we handle this.