LaurentRDC / pandoc-plot

Render and include figures in Pandoc documents using your plotting toolkit of choice
https://laurentrdc.github.io/pandoc-plot/
GNU General Public License v2.0
223 stars 8 forks source link

Path Problems #2

Closed MiuKaShi closed 4 years ago

MiuKaShi commented 4 years ago

Laurent, First, thank you for creating this pandoc filter plugin. I used your prebuilt plugin for windows but it can not work.

D:\Tplot
$ pandoc --filter pandoc-plot input.md --output output.html
python: can't open file 'C:\Users\Zhang': [Errno 2] No such file or directory
pandoc-plot: The script failed with exit code 2

I had checked the running environment, it seems ok

D:\Tplot
$ pandoc --version
pandoc 2.9.2
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2
Default user data directory: C:\Users\Zhang Ke\AppData\Roaming\pandoc
Copyright (C) 2006-2019 John MacFarlane
D:\Tplot
$ pandoc-plot --toolkits

AVAILABLE TOOLKITS

Toolkit: Python/Matplotlib
    Code block trigger: matplotlib
    Supported save formats: PNG, PDF, SVG, JPG, EPS, GIF, TIF

Toolkit: MATLAB
    Code block trigger: matlabplot
    Supported save formats: PNG, PDF, SVG, JPG, EPS, GIF, TIF

Toolkit: Python/Plotly
    Code block trigger: plotly_python
    Supported save formats: PNG, JPG, WEBP, PDF, SVG, EPS

Toolkit: GNU Octave
    Code block trigger: octaveplot
    Supported save formats: PNG, PDF, SVG, JPG, EPS, GIF, TIF

Toolkit: ggplot2
    Code block trigger: ggplot2
    Supported save formats: PNG, PDF, SVG, JPG, EPS, TIF

Toolkit: gnuplot
    Code block trigger: gnuplot
    Supported save formats: PNG, SVG, EPS, GIF, JPG, PDF

UNAVAILABLE TOOLKITS

Toolkit: Mathematica

I notice that there is a space in my computer user name zhang ke, so I think maybe the pandoc-plot can not recognize the correct route path due to this space. Cloud you help me to fix this problem ? Thank You,

LaurentRDC commented 4 years ago

Hello,

I notice that the error line has to do with python itself, and not pandoc-plot directly. Did you use a configuration file .pandoc-plot.yml? Can I see the code block, if you don't mind?

LaurentRDC commented 4 years ago

I see what you mean about the path having a space. It could also be this. I have found that the paths were not enclosed in quotes.

Let me try to fix this quickly!

LaurentRDC commented 4 years ago

Your problem should be fixed with release 0.2.2.0.

Please uninstall the previous version before installing the new one, and let me know how it goes.

MiuKaShi commented 4 years ago

Thank you for your reply and help. I just update the pandoc-plot to 0.2.2.0, and the paths problem is fixed! It works well for me.

LaurentRDC commented 4 years ago

Wonderful!

Thank you for filing a bug report. Please do not hesitate if you find anything else that doesn't work as expected :)

Dvbnhbq commented 4 years ago

Hello, Laurent. Thank you for your great project. I am getting a similar error (previousely worked fine on v. 0.5.0.0). Error message:

ERROR |     self._reader = parsers.TextReader(src, **kwds)
ERROR |   File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
ERROR |   File "pandas/_libs/parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source
ERROR | FileNotFoundError: [Errno 2] No such file or directory: 'db/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv'
ERROR |
ERROR | *******
ERROR | Script failed with exit code 1 and the following message: python3 "/tmp/pandocplot6574213974346944389.py"
LaurentRDC commented 4 years ago

Hello @Dvbnhbq,

It appears that the script you are running requires a file ("time_series_covid19_confirmed_global.csv").

Is the file path specified absolutely, or relatively to where you run pandoc-plot?

Dvbnhbq commented 4 years ago

Hi @LaurentRDC,

This path is relative to the current directory where pandoc --filter pandoc-plot is executed. This was working fine until some update. I've just downgraded to v. 0.5.0.0 to test if something is broken on my side, and everything is working correctly with the same path after the downgrade.

LaurentRDC commented 4 years ago

I think I know what's going on. I'll try to push a fix today.

I'm sorry for the trouble - getting these details right for every plotting toolkit has proven to be rather arduous.

Dvbnhbq commented 4 years ago

Thank you for maintaining this. I've built this from the latest commit, looks fine now!

LaurentRDC commented 4 years ago

That's great news. Once this last round of testing has passed, look out for version 0.9.4.0.

LaurentRDC commented 4 years ago

Version 0.9.4.0 was just published to Hackage and Github. conda-forge will follow in the next 24h.

I will close this for now. Don't hesitate to re-open this issue if the problem persists!