asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
439 stars 107 forks source link

Could not find the 'blockdiag', 'blockdiag3' executable in PATH (Windows) #421

Closed ioannisstavrakakis closed 1 year ago

ioannisstavrakakis commented 1 year ago

I would need to know where you have blockdiag installed, what the value of the PATH environment variable is, and what the exact filename of the blockdiag executable is, including the extension. When running asciidoctor-pdf -r asciidoctor-diagram --trace test.adoc in Windows, I get the following error:

asciidoctor: ERROR: test.adoc: line 248: Failed to generate image: Could not find the 'blockdiag', 'blockdiag3' executable in PATH;add it to the PATH or specify its location using the 'blockdiag' document attribute

User variable PATH: C:\Python311\Lib\site-packages\blockdiag System variable PATH: C:\Python311\Lib\site-packages\blockdiag

This is where blockdiag is installed:

image

I can also see this folder, C:\Python311\Lib\site-packages\blockdiag-3.0.0.dist-info:

image

pepijnve commented 1 year ago

There doesn't seem to be an executable wrapper anywhere. That's what the diagram code is looking for. I don't have a Windows installation to test this on myself, but could you check elsewhere in the python install dir if there's a .exe wrapper for blockdiag somewhere?

ioannisstavrakakis commented 1 year ago

I unisntalled and reinstalled it, and now I notice this error message during installation:

pip install blockdiag
Collecting blockdiag
  Using cached blockdiag-3.0.0-py3-none-any.whl (2.7 MB)
Requirement already satisfied: setuptools in c:\python311\lib\site-packages (from blockdiag) (65.5.0)
Requirement already satisfied: funcparserlib>=1.0.0a0 in c:\python311\lib\site-packages (from blockdiag) (1.0.1)
Requirement already satisfied: Pillow>3.0 in c:\users\istavrak\appdata\roaming\python\python311\site-packages (from blockdiag) (9.5.0)
Requirement already satisfied: webcolors in c:\python311\lib\site-packages (from blockdiag) (1.13)
Installing collected packages: blockdiag
  WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'C:\\Python311\\Scripts\\blockdiag.exe' -> 'C:\\Python311\\Scripts\\blockdiag.exe.deleteme'
pepijnve commented 1 year ago

Based on https://github.com/pypa/pip/issues/9023 you need to install as a user with Administrator privileges

ioannisstavrakakis commented 1 year ago

Yes, that did the trick! Many thanks!