Questions tagged [reticulate]

Usage questions regarding reticulate R package which provides a comprehensive set of tools for interoperability between Python and R.

Questions on the reticulate R package which provides a comprehensive set of tools for interopability between Python and R. More information on tutorials and API reference can be found on reticulate's website.

486 questions
1
vote
1 answer

running Python script using system2() works in R terminal but not RStudio

Given a simple python script, "test.py": from sys import stdout stdout.write("text out") Calling this from the R terminal using system2() works as expected: python <- "C:/Users/username/Anaconda3/envs/general/python.exe" script <-…
zephryl
  • 14,633
  • 3
  • 11
  • 30
1
vote
0 answers

R reticulate on M1 Mac OSX

Python 3.11.3 and R4.3.0 Upon loading any package, already installed via py_install or pip on the terminal, I get this weird error. I don't even know where to start. Somehow rpytools doesn't seem to work. Traceback (most recent call last): File…
inferator
  • 474
  • 3
  • 12
1
vote
1 answer

Unexpected syntax error after loading reticulate package

I've loaded "reticulate" package to run python code in Rstudio. Below the code: # Initialize an empty dictionary D = {} L = [['a', 1], ['b', 2], ['a', 3], ['c', 4]] I get the following error: Error: unexpected '[[' in "L = [[" Why did this…
Fra_Silver
  • 11
  • 2
1
vote
1 answer

Unable to load pandas in R reticulate due to missing GLIBCXX_3.4.29

I'm trying to use R's reticulate package for loading python's pandas package in R. I have python3.8, and I installed pandas through conda. In python pandas imports fine but in R, after loading reticulate I get this error: > pd <-…
user1701545
  • 5,706
  • 14
  • 49
  • 80
1
vote
3 answers

How to Remove Conda environment in R with reticulate?

I installed the package tabulate in RStudio by the code from the reticulate documentation. With the simple installation code: library(reticulate) py_install("tabulate") It works perfectly except the warning message: the tabulate version is low and…
Pai
  • 41
  • 5
1
vote
0 answers

Running Python in R Studio

I'm trying to start using R studio as IDE for python, but I cannot even start doing so because miniconda installation fails to complete. As follows. reticulate::repl_python() No non-system installation of Python could be found. Would you like to…
1
vote
0 answers

How to fix 'Error in normalizePath(conda, winslash = "/", mustWork = TRUE) ' when using reticulate package in R

Background I had some python code in a .py file stored in an R studio project. I was successfully using R studio (version 2022.7.1.554) and the reticulate package (verson 1.26) to write and run the python code. I was using anaconda3 rather than…
ifoxfoot
  • 195
  • 7
1
vote
0 answers

Error in dir.exists(x) : file name conversion problem -- name too long?

I am trying to import a .py file in RStudio and I am getting the error message: Error in dir.exists(x) : file name conversion problem -- name too long?) I have already tried to run it through a path that only contains English letters and it…
Katerina
  • 11
  • 1
1
vote
0 answers

Using Spacyr with GPU through Reticulate

I'd like Spacyr to use GPU in R. I work on ARM64 architecture (Mac M1) and I have installed the latest nighlty version of Spacy, which supports GPU. Although, when I initialize Spacy in R by using reticulate, the model doesn't use GPU. This is what…
1
vote
0 answers

Error creating conda environment 'r-reticulate' [exit code 1]

I am trying to use BERT in R and for that I need some bits from Python. However when I try to install transformers, e.g., I am getting the error above. These are the lines I tried, all failed with the same…
Omry Atia
  • 2,411
  • 2
  • 14
  • 27
1
vote
1 answer

Convert a .Rmd notebook that contains both R and python chunks to an .R script

I would like to convert an R Markdown notebook that contains both R and python chunks to an R script for execution on a backend server. We use a python pipeline to prepare the data. R code continues the analysis. The R markdown notebook comes from…
Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110
1
vote
1 answer

R: Error in py_initialize() while using Reticulate package

I am using the Azure ML Notebook with R kernel and reticulate package is installed with version 1.25. When I run the following code: library(reticulate) Sys.which("python") It gives the output as python: '/usr/bin/python' and so, I have used…
ankit
  • 277
  • 1
  • 4
  • 25
1
vote
2 answers

Saving API terminal output to JSON file

I am exporting data from a sensor. The command to download the logged data from the sensor is: e = Event() libmetawear.mbl_mw_logging_download(d.board, 0, byref(download_handler)) e.wait() download_handler is a function from the sensor…
mkp
  • 51
  • 6
1
vote
0 answers

Use reticulate and python in docker container to deploy plumber api

I am trying to deploy plumber API to Azure web service (as web app) using instructions from this site https://veerlevanleemput.medium.com/hosting-a-r-plumber-api-using-azure-app-service-4e78936787cf I have problem with adding python and reticulate…
Mislav Sagovac
  • 185
  • 1
  • 8
1
vote
1 answer

Reticulate not accessing data when using within Shiny

i'm trying to execute some python class object (using reticulate) which works fine when i'm using it outside of Shiny, but when i run my script within Shiny I get the following error message 'Warning: Error in py_run_string_impl: RuntimeError:…
tezzaaa
  • 459
  • 1
  • 6
  • 17