pandoc-plantuml-filter icon indicating copy to clipboard operation
pandoc-plantuml-filter copied to clipboard

Filter cannot find executable pandoc-plantuml

Open ghost opened this issue 1 year ago • 14 comments

I have attempted to install and utilize this Pandoc filter in Windows 10, but calling --filter pandoc-plantuml returns the error:

Error running filter pandoc-plantuml:    
Could not find executable pandoc-plantuml

ghost avatar Nov 02 '22 11:11 ghost

It says that you don't have pandoc-plantuml in your path. I have no idea how the python code is generally installed on win hosts, but it's really nothing related particular to this repo.

You need to have pandoc-plantuml executable accessible from any directory on your host.

Felixoid avatar Nov 02 '22 11:11 Felixoid

The plantuml.jar and pandoc-plantuml-filter.py should both be in path, but perhaps I am missing something else. I don't have this issue when installing plantuml through Homebrew in macOS, but I am unsure what the pandoc-plantuml executable is supposed to be in Windows.

ghost avatar Nov 02 '22 11:11 ghost

Just in case, did you try --filter pandoc-plantuml-filter? Because then pandoc-plantuml-filter in your PATH

Felixoid avatar Nov 02 '22 11:11 Felixoid

Calling pandoc --filter pandoc-plantuml-filter --defaults "contents.yaml" --reference-doc "reference.docx" -o "output.docx" -f markdown -t docx returns a similar error. It's probably just not in path, which it automatically was with Homebrew.

Error running filter pandoc-plantuml-filter:    
Could not find executable pandoc-plantuml-filter

I added C:\Users\twl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages to Path, which contains my Python packages, including the files pandoc_plantuml_filter.py, pandocfilters.py and plantuml.py.

ghost avatar Nov 02 '22 12:11 ghost

I have the same problem than you under W10

jlstanus avatar Jan 20 '23 16:01 jlstanus

i did pip uninstall pandocfilters then reinstall pip install pandoc-plantuml-filter. The command line stoopped to return a not found error with the documented --filter pandoc-plantuml-filter but i get the following error: OSError: [WinError 193] %1 is not a valid Win32 application

jlstanus avatar Feb 08 '23 17:02 jlstanus

Hello, I have installed the pandoc-plantuml filter according to the readme file, but I got the same error. Problem not solved? I have pandoc 2.10, windows 10, all paths are indicated

aleyner avatar Jul 31 '23 14:07 aleyner

I assume this is still an issue? Anyone interested in setting up the CI to run on windows?

fliiiix avatar Oct 03 '23 17:10 fliiiix

I took a long look at this and it is cursed, someone please share a setup how you installed and run:

  • pandoc
  • plantuml
  • things installed via pip
  • pandoc-plantuml

For the original issue by @ghost my guess would be:

C:\Users\$USER\AppData\Local\Programs\Python\Python39\Scripts

was not part of the path

fliiiix avatar Oct 07 '23 16:10 fliiiix

Since there is no activity here i will close it for now i assume this is still an issue on windows. If you share a way to reproduce this im more than happy to reopen this issue and look at it.

fliiiix avatar Dec 10 '23 12:12 fliiiix

i did pip uninstall pandocfilters then reinstall pip install pandoc-plantuml-filter. The command line stoopped to return a not found error with the documented --filter pandoc-plantuml-filter but i get the following error: OSError: [WinError 193] %1 is not a valid Win32 application

I was able to get this to work by making a dos batch file named plantuml.bat and setting the environment variable PLANTUML_BIN to its path.

Batch File

java -jar c:\PathToPlantUmlJar\plantuml.jar %*

Caveat

I was able call pandoc and have it work from the command prompt but not from PowerShell.

kaoscillate avatar Jan 16 '24 20:01 kaoscillate

Thanks for sharing i will taken an other look at this at some point windows is weird to me :sweat_smile: so if someone has experience feel free to propose solutions for this issue :D

fliiiix avatar Jan 20 '24 09:01 fliiiix

Here are some install instructions I wrote up:

Windows Install

Components:

  1. PlantUML https://plantuml.com/
  2. Pandoc https://pandoc.org/
  3. A PlantUML Pandoc filter https://github.com/timofurrer/pandoc-plantuml-filter

Component Install

PlantUML

Download the plantuml jar file for the PlantUML site: https://plantuml.com/download

Make a batchfile, plantuml.bat, to make PlantUML available to the Pandoc filter. Place plantuml.bat into your path. plantuml.bat contents:

java -jar c:\PathToPlantUMLJAR\plantuml_jarname.jar %*

Set PLANTUML_BIN in your environmental variables to the path to plantuml.bat as well.

Pandoc

You can install pandoc using chocolatey:

choco install pandoc

Pandoc PlantUML filter

pip install pandoc-plantuml-filter

BTW, I also was able to get everything to work in PowerShell. There's an intermittent error with some JSON generation in both the "Command Prompt" and PowerShell where it looks like a Windows path where it looks like the \ is not escaped. But it goes away and works anyway on the next run. Haven't had time to run it down yet.

kaoscillate avatar Jan 22 '24 19:01 kaoscillate