Knitting Python Code in R Markdown file crashes if calling plotnine or deploy...

am learning RStudio for a business school course that requires coding in both R and Python.

I am using the "Reticulate" library (based on the miniconda package) to use Python.

My R and Python all code works fine in RStudio. However, when I try to Knit the Notebook file (to any output type, html, Word, etc.), only the R code will work. As soon as the Knit function encounters a call to the plotnine or dfply like:

(ggplot(data =, 
  mapping=aes(x='carat', y='price', color = 'color')) 
  + geom_point()

I get the following errors, and knitting execution fails:

Quitting from lines 23-27 (kint_test_4.Rmd)
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: TypeError: type object got multiple values for keyword argument 'visible'

Detailed traceback:
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 838, in clf
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 1795, in clf
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 1051, in cla
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 788, in cla
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 811, in reset_ticks
File "C:\Users\walam\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\matplotlib\", line 901, in set_clip_path
for child in self.m
Calls: ... py_capture_output -> force -> -> py_call_impl
Execution halted

Simple Python code like
Print("Hello World!")
runs fine. It's the calls to plotnine or deploy that case the problemm.

I'm just plain stuck trying to debug this.

Any Suggestions?

Thanks in advance for any help,


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.