timofurrer / pandoc-plantuml-filter

Pandoc filter for PlantUML code blocks
https://pypi.org/project/pandoc-plantuml-filter
MIT License
104 stars 26 forks source link

Filter cannot find executable pandoc-plantuml #21

Open ghost opened 1 year ago

ghost commented 1 year ago

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
Felixoid commented 1 year ago

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.

ghost commented 1 year ago

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.

Felixoid commented 1 year ago

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

ghost commented 1 year ago

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.

jlstanus commented 1 year ago

I have the same problem than you under W10

jlstanus commented 1 year ago

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

aleyner commented 1 year ago

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

fliiiix commented 12 months ago

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

fliiiix commented 11 months ago

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

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 commented 9 months ago

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.

kaoscillate commented 8 months ago

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.

fliiiix commented 8 months ago

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

kaoscillate commented 8 months ago

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.

sancharly commented 3 months ago

Im having the same problem with macOS Sonoma 14.5.

I installed pandoc (Works fine) I installed java and PlantUML (Works fine) I installed the filter following the instructions. The pandoc-plantuml executable is in the path:

which pandoc-plantuml 
/Library/Frameworks/Python.framework/Versions/3.10/bin/pandoc-plantuml

when I run pandoc with the option -F pandoc-plantuml,I get:

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

Any Ideas?

Thank you

captaincarmnlg commented 2 months ago

perhaps a chocolatey package could be made to fix this problem? because both Plantuml and pandoc have a package for it and the cross-ref filter has a package too. this would also make for a cleaner install. For Mac, you could do the same for homebrew although this would probably be hard to test