I can't run python code in R Studio

I am no longer able to run python code in R Studio. I was able to before, but that suddenly stopped. Anytime I create a python script and try to run a code, I will just get the message "Executing Python Code", but nothing ever happens, until I kill or restart R Studio. I first thought the problem might be updating R Studio, which I have done. I also tried to update the reticulate package but neither has solved the problem. As of now, I can't use python code in an R project, and I have to use jupyter notebook to run python code. I am totally confounded as to why this is happening.

Post scripts that reproduce the problem, along with SessionInfo? Don’t neglect representative data.

Hi, it is a simple python code print("Hello World!"). When I run this line of code in R Studio, I get the red stop button in my console, which indicates that a process is running and the console is out of use at the moment. It stays that way until I have to terminate the session. In addition, sometimes, I get the following error message in my console:

reticulate::repl_python()
Error in main_process_python_info() : 
  function 'Rcpp_precious_remove' not provided by package 'Rcpp'

I have Rcpp installed.

No I have not tried that. I will update Rcpp and see how that goes. Thanks!

I can confirm Rcpp_1.0.7 works under R4.1 in Ubuntu

1 Like

I got this new error message after updating Rcpp to 1.0.7 and running a python code:

Error in main_process_python_info() : 
  function 'Rcpp_precious_remove' not provided by package 'Rcpp'

Depending on how you have set up your R packages (especially if you built from source), you may also want to rebuild/recompile any R package that depends on Rcpp, too.

1 Like

Do I need to uninstall reticulate package and reinstall it? Could that help? I am using a Windows machine.

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.