0
title: "Python in R"
output: html_document
version: RStudio 2021.09.0 Build 351 "Ghost Orchid"
OS: macOS Monterey 12.0.1
knitr::opts_chunk$set(echo = TRUE)
library (reticulate)
repl_python()
reticulate::py_config()

pd <- import("pandas")
pp<- import("pandas-profiling")
plt <- import("matplotlib.pyplot")
np <- import("numpy")

Error in py_module_import(module, convert = convert) : ModuleNotFoundError: No module named 'pandas-profiling'

3.stop(structure(list(message = "ModuleNotFoundError: No module named 'pandas-profiling'", call = py_module_import(module, convert = convert), cppstack = structure(list( file = "", line = -1L, stack = c("1 reticulate.so 0x0000000105fffb6e _ZN4Rcpp9exceptionC2EPKcb + 222", "2 reticulate.so 0x0000000106008975 _ZN4Rcpp4stopERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 53", ... 2.py_module_import(module, convert = convert) 1.import("pandas-profiling")

First of all, I am a novice at these things. I'm trying to run python in R. Except for pandas-profiling package, everything is loading fine. Can someone suggest me a work around for this one? What am I missing here?

pavanv
  • 13
  • 4
  • Just curious, why do you want to run python in R? why not just run python on its own? Also it seems you want to do some analysis. Is there a reason as to why you can not use R by itself? Anyway you will have to install the pandas profiling package – Onyambu Dec 22 '21 at 02:15
  • Thanks for asking. I have some experience in R which makes it easy for me to run the codes in R. I'm also doing it in the jupyter notebook. Simultaneously, I am trying to run the same in R, so that it helps me in long run. And for the installation thing, I have tried that too using 'py_install(pandas-profiling)'. That line runs fine with no errors. When I try to import it, then it's showing me error. – pavanv Dec 22 '21 at 13:37

0 Answers0