quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.78k stars 309 forks source link

Add a guide on how to setup Python on Windows to work well with Quarto #4737

Open cderv opened 1 year ago

cderv commented 1 year ago

This is a topic that comes up often and I think our current guide is not enough and needs to be updated. Also some improvment needs to be made first. Context below

To solve

Related

Resources

abigailhaddad commented 1 year ago

Following on the last thread -- the content of kernel.json is the following:

{ "argv": [ "python", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], "display_name": "Python 3 (ipykernel)", "language": "python", "metadata": { "debugger": true } }

jupyter kernelspec list produces the following error:

Fatal error in launcher: Unable to create process using '"C:\Python311\python.exe" "C:\Users\abiga\AppData\Roaming\Python\Python311\Scripts\jupyter.exe" kernelspec list': The system cannot find the file specified.

But the bigger usability issue with quarto and Python for me isn't this, because I can hard-code my package locations - although not ideal. The plotly issues I don't have a workaround for -- the "“Unable to display output for mime type(s): text/html” when I try to put a figure in a docx or PDF file (in contrast with an HTML file, which works), and the errors that I get with trying to workaround this by writing out the file to a .PNG and then embedding it.

cderv commented 1 year ago

The plotly issues I don't have a workaround for -- the "“Unable to display output for mime type(s): text/html” when I try to put a figure in a docx or PDF file (in contrast with an HTML file, which works),

This is another issue indeed. Plotly generate interactive HTML and HTML can't be embed in PDF output. There is no automatic screenshot of your Plotly graph by Jupyter - knitr does that for R. So you need to use conditional content to adapt your code to the output.

and the errors that I get with trying to workaround this by writing out the file to a .PNG and then embedding it.

Please to open a discussion item about this to share your tires and issue. I don't know what you are trying to export a plotly to PNG or PDF, but following this part of Plotly docs works for me: https://plotly.com/python/static-image-export/

Anyhow, discussion for another issue.

JuanCruzC97 commented 4 months ago

But the bigger usability issue with quarto and Python for me isn't this, because I can hard-code my package locations - although not ideal. The plotly issues I don't have a workaround for -- the "“Unable to display output for mime type(s): text/html” when I try to put a figure in a docx or PDF file (in contrast with an HTML file, which works), and the errors that I get with trying to workaround this by writing out the file to a .PNG and then embedding it.

Any updates on this?

aalexandersson commented 2 months ago

To me, it seems feasible to move up the milestone by focusing only on Quarto with Positron (not on RStudio with Quarto).

The pull Bundle the Quarto extension #3727 is merged for Positron. For Positron, the issue becomes "Add a guide on how to setup Python on Windows to work well with Positron".

cscheid commented 2 months ago

I appreciate the enthusiasm, but to be frank, we're the best judges on feasibility, thanks.