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
4
votes
2 answers

Reticulate - Get Python result without assigning to variable

If possible i would like to print the result of python Code in R (without assigning to a variable). This works: library(reticualte) py_run_string("print(2)") 2 This works: p = py_run_string("x = 2") p$x 2 I would like this to…
Tlatwork
  • 1,445
  • 12
  • 35
4
votes
1 answer

Reticulate data from R to python and back to R again

Where am I going wrong here? I am in RStudio and I want to do some processing on some text data in Python and bring it back to R for some final analysis / plots but I get the error: NameError: name 'df_py' is not defined Data & Code: text <-…
user113156
  • 6,761
  • 5
  • 35
  • 81
4
votes
2 answers

Reticulate can't install python packages

I'm trying to run the Seurat pipeline in RStudio (Windows 10 , which requires having the python library 'umap-learn' installed (Seurat walkthrough: https://satijalab.org/seurat/v3.0/pbmc3k_tutorial.html). To install said library, I'm using the…
Lukas Vlahos
  • 41
  • 1
  • 5
4
votes
1 answer

Rmarkdown doc doesn't compile with python chunk

I'm trying to use the reticulate package to run Python chunks in an .Rmd file. My problem is that the Python code will run in-line, but the document won't knit-- it hangs at 100% with no output and there are no error messages. I assumed it was a…
Nancy
  • 3,989
  • 5
  • 31
  • 49
4
votes
1 answer

Passing R variables to a python script with reticulate

I have a python script that I want to run from within R using the reticulate package. I want to assign some variables in R first, and then pass them to the script. Unfortunately when I run the script, I am surprised to see that python can't…
Jacqueline Nolis
  • 1,457
  • 15
  • 22
4
votes
1 answer

R reticulate package and python sub-modules

When trying to mimic some python code using R's reticulate package: import_from_path("jwt_auth", "C:/Program Files/Python 3.5/Lib/site-packages/boxsdk/auth") I get this error: Error in py_module_import(module, convert = convert) : SystemError:…
4
votes
1 answer

Web3.py HTTPProvider requests SSL certificates

Environment: Corporate firewall Problem: When calling w3 = Web3(Web3.HTTPProvider("https://ropsten.infura.io/v3/API_KEY")) in web3.py, the request will be blocked by firewall with SSLError("Can't connect to HTTPS URL because the SSL module is…
WQL
  • 41
  • 1
4
votes
4 answers

Qt platform plugin issue Rstudio

I am trying to do a seaborn heatmap plot via RStudio. I usereticulate package in R. Below is my code: library(reticulate) use_condaenv("python36", conda = "auto", required = FALSE) os <- import("os") os$listdir(".") py_available() sns <-…
Naive_Natural2511
  • 687
  • 2
  • 8
  • 20
4
votes
2 answers

ModuleNotFoundError: No module named 'rpytools' while using reticulate library

Hi this is my first stackoverflow question so sorry in advance for any mistakes. I am trying to start playing with R reticulate library. I have installed the package, and tried to import os Python module. Everything seemed to be ok, but then while I…
4
votes
1 answer

R - Reticulate won't convert numpy array to matrix

In R using Reticulate I create a numpy array like so: > library(reticulate) > np <- import("numpy") > np$array(c(1,2,3)) [1. 2. 3.] However, I cannot convert it back to a vector. > py_to_r(np$array(c(1,2,3))) [1. 2. 3.] I experience this problem…
Christopher Costello
  • 1,186
  • 2
  • 16
  • 30
3
votes
1 answer

How to activate existing Python environment with R reticulate

I have the following existing Python environments: $ conda info --envs base * /home/ubuntu/anaconda3 tensorflow2_latest_p37 /home/ubuntu/anaconda3/envs/tensorflow2_latest_p37 What I want to do is to activate…
littleworth
  • 4,781
  • 6
  • 42
  • 76
3
votes
0 answers

how to fix Error environment when using reticulate with command install_miniconda()

I can't fix this error when I install miniconda in Windows 11 with reticulate. Here is the message : reticulate::install_miniconda() Installing Miniconda -- please wait a moment ... Downloading…
chc
  • 47
  • 3
3
votes
1 answer

R Reticulate - Moving defined variables programmatically from Python environment to R

Caue: I'm creating dataframes programmatically in Python using globals(). In the below code, I'm creating 5 datasets that starts with a 'PREFIX' in caps, followed by a letter then ending with a…
3
votes
1 answer

How do I access Anaconda environment from R reticulate if it is in my WSL home directory?

I have a working anaconda distribution (can install conda environments/packages and use them in Python). Now I'm trying to use an anaconda environment in Rstudio using the reticulate library but it can't seem to find my anaconda environments. I use…
Os GS
  • 69
  • 6
3
votes
2 answers

Read a Pandas dataframe into R

I have used reticulate package to source python code in R. source_python("data_loading.py") df = my_data() str(df) 'data.frame': 268 obs. of 13 variables: $ DKF: num 1.352 1.283 1.246 0.73 0.784 ... $ GDT: num NaN NaN NaN NaN NaN NaN NaN…
Haribo
  • 2,071
  • 17
  • 37