Closed MageJohn closed 2 years ago
Thank you for your report! Let me take a look
I found the problem, and it is right here. In the expression Executable _ exename
, the directory is ignored (_
).
I'll try to patch this tonight
In the meantime, you can specify the absolute path to the executable in the .pandoc-plot.yml
config file like so:
#.pandoc-plot.yml in the same directory where you are running `pandoc` and `pandoc-plot`
matplotlib:
executable: /full/path/to/venv/bin/python
I've tested that this works
That's strange, it was actually using the configuration file that I first noticed the problem. I didn't mention it earlier because I was trying to provide a minimal description of the issue, and I didn't think the configuration file would make a difference.
I'll try again however, I might have missed something.
Update: for me there's no difference from using the config file, even when I carefully set it up just like your comment. I can tell that the file is being read, because the executable changes from python3
to just python
again, but the absolute path is still being lost.
You are right, it works now with the config file only because I've fixed this. Stay tuned for the global fix
A fix has been merged into master. I'm preparing a release for tonight
That's amazing, thank you!
You are most welcome. Don't hesitate to raise other issues if you encounter other problems.
I'm trying to configure the python executable for running matplotlib to one in a virtual environment. I need to do this to have access to all the installed packages there. Unfortunately pandoc-plot seems to ignore the setting and still runs the system version of python.
Specifically I have a source script that looks something like the following, where
some_package
is a package installed only in the venv:[pandoc-plot] ERROR | Running command [pandoc-plot] ERROR | python "/tmp/pandocplot4826263390304275862.py" [pandoc-plot] ERROR | ended with exit code ExitFailure 1 [pandoc-plot] ERROR | [pandoc-plot] ERROR | sys.executable=/usr/bin/python [pandoc-plot] ERROR | Traceback (most recent call last): [pandoc-plot] ERROR | File "/tmp/pandocplot4826263390304275862.py", line 9, in
[pandoc-plot] ERROR | import some_package
[pandoc-plot] ERROR | ModuleNotFoundError: No module named 'some_package'
[pandoc-plot] ERROR |
[pandoc-plot] ERROR |
[pandoc-plot] ERROR | Command "python "/tmp/pandocplot4826263390304275862.py"" failed with exit code 1. The script source was:
[pandoc-plot] ERROR |
[pandoc-plot] ERROR | 1 > import sys
[pandoc-plot] ERROR | 2 > print(f"sys.executable={sys.executable}", file=sys.stderr)
[pandoc-plot] ERROR | 3 > import some_package
[pandoc-plot] ERROR |