Disable Reticulate Message in RMarkdown

First of all I'm using rmarkdown and reticulate package for python code chunks.

Each time I execute a python code chunk, the message below gets printed on the editor, not in html output:

Python 3.7.9 (C:/Program Files/Python37/python.exe)
Reticulate 1.18 REPL -- A Python interpreter in R.

I want to remove this message, because it's useless and distracting. So, I tried using message=FALSE option but it then I lose some useful info about python errors. For example: when I write an erroneous code, use a function that doesn't exists, reticulate doesn't say anything about the error and I had no idea if the code chunk worked or not, when the message=FALSE


Normally, pandas series has no function named sort. So, it won't work. When, message=TRUE I get the error:

AttributeError: 'Series' object has no attribute 'sort'

Is there a way to disable the reticulate message but keep the python messages?

Version Info:
knitr: 1.30
reticulate: 1.18
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

From reticulate::repl_python() help page, I think you can set this option to TRUE to make it quiet

options(reticulate.repl.quiet = TRUE)

Either in a chunk above or in your .Rprofile.


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.