Code Monkey home page Code Monkey logo

Comments (5)

LaurentRDC avatar LaurentRDC commented on June 2, 2024

Hi!

The only thing I can think of is that pandoc-plot defaults to using python3. From this line:

[pandoc-plot] ERROR |     python3 -c "import plotly.graph_objects"

I'm not a user of Linux/MacOS, but does python3 refer to your conda installation, or your system installation?

from pandoc-plot.

xubeisi avatar xubeisi commented on June 2, 2024

thanks for quick reply! it should be my conda installation, I also tried manually provide python location in config file. None worked.

But I think you are point to a good direction. However, I am not familiar with Haskell.

Would you mind help me find a way to print python output in

https://github.com/LaurentRDC/pandoc-plot/blob/master/src/Text/Pandoc/Filter/Plot/Renderers/PlotlyPython.hs ?

so I could

import sys
print(sys.executable)

to find out which one it use.

Thank you!

from pandoc-plot.

LaurentRDC avatar LaurentRDC commented on June 2, 2024

Hmm pandoc-plot does not capture stdout, so printing like you suggested wouldn't work. What you can do instead is write to file:

Here's input.md:

# My document

This is a paragraph.

```{.matplotlib}
import matplotlib.pyplot as plt
import sys

print(sys.executable, file="here.txt")

plt.figure()
plt.plot([0,1,2,3,4], [1,2,3,4,5])
plt.title('This is an example figure')
```

then the content of file "here.txt" will help us diagnose the problem

from pandoc-plot.

xubeisi avatar xubeisi commented on June 2, 2024

works and you first thought were right, it was using the system python but not the conda one..

In my .pandoc-plot.yml I tried change the python path

# The possible parameters for the Matplotlib toolkit
matplotlib:
  # preamble: matplotlib.py
  tight_bbox: false
  transparent: false
  executable: /home/user/.conda/python
  command_line_arguments:

I also tried

-M plot-configuration=/path/to/file.yml

or put in input.md

---
title: My document
author: John Doe
plot-configuration: /home/user/pandoc-plot/.pandoc-plot.yml
---

still using system python, it report error and here.txt won't be generated.

[INFO] Running filter pandoc-plot
[pandoc-plot] ERROR | Dependency file1.txt does not exist.
[pandoc-plot] ERROR | Dependency file2.txt does not exist.
[INFO] Completed filter pandoc-plot in 9 ms

I looked around pandoc's document, maybe they just didn't support virtual env?

Thank you!

from pandoc-plot.

LaurentRDC avatar LaurentRDC commented on June 2, 2024

Allright let me know if you have any other issue!

from pandoc-plot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.