Hi,I am having a hard time getting Python to work in R via Reticulate. I downloaded Anaconda, R, Rstudio, and Python to my system. Below are their paths:
Python: C:UsersJohnAppDataLocalMicrosoftWindowsApps
Anaconda: C:UsersJohnanaconda3R: C:Program FilesRR-4.2.1
Rstudio: C:ProgramDataMicrosoftWindowsStart MenuPrograms
But within R, if I do “Sys.which(“python”)”, the following path is displayed:
“C:\Users\John\DOCUME~1\VIRTUA~1\R-RETI~1\Scripts\python.exe”
Now, whenever I call upon reticulate in R, it works, but after giving the error: “NameError: name ‘library’ is not defined”
I can use Python in R, but I’m unable to import any of the libraries that I installed, including pandas, numpy, etc. I installed those in Anaconda (though I used the “base” path when installing, as I didn’t understand the whole ‘virtual environment’ thing). Trying to import a library results in the following error:”
File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 122, in _find_and_load_hook return _run_hook(name, _hook) File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 96, in _run_hook module = hook() File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 120, in _hook return _find_and_load(name, import_) ModuleNotFoundError: No module named 'pandas'
“Does anyone know of a resolution? Thanks in advance.
submitted by /u/Maleficent-Seesaw412
[link] [comments]
r/learnpython Hi,I am having a hard time getting Python to work in R via Reticulate. I downloaded Anaconda, R, Rstudio, and Python to my system. Below are their paths: Python: C:UsersJohnAppDataLocalMicrosoftWindowsApps Anaconda: C:UsersJohnanaconda3R: C:Program FilesRR-4.2.1 Rstudio: C:ProgramDataMicrosoftWindowsStart MenuPrograms But within R, if I do “Sys.which(“python”)”, the following path is displayed: “C:\Users\John\DOCUME~1\VIRTUA~1\R-RETI~1\Scripts\python.exe” Now, whenever I call upon reticulate in R, it works, but after giving the error: “NameError: name ‘library’ is not defined” I can use Python in R, but I’m unable to import any of the libraries that I installed, including pandas, numpy, etc. I installed those in Anaconda (though I used the “base” path when installing, as I didn’t understand the whole ‘virtual environment’ thing). Trying to import a library results in the following error:” File ” C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py “, line 122, in _find_and_load_hook return _run_hook(name, _hook) File ” C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py “, line 96, in _run_hook module = hook() File ” C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py “, line 120, in _hook return _find_and_load(name, import_) ModuleNotFoundError: No module named ‘pandas’ “Does anyone know of a resolution? Thanks in advance. submitted by /u/Maleficent-Seesaw412 [link] [comments]
Hi,I am having a hard time getting Python to work in R via Reticulate. I downloaded Anaconda, R, Rstudio, and Python to my system. Below are their paths:
Python: C:UsersJohnAppDataLocalMicrosoftWindowsApps
Anaconda: C:UsersJohnanaconda3R: C:Program FilesRR-4.2.1
Rstudio: C:ProgramDataMicrosoftWindowsStart MenuPrograms
But within R, if I do “Sys.which(“python”)”, the following path is displayed:
“C:\Users\John\DOCUME~1\VIRTUA~1\R-RETI~1\Scripts\python.exe”
Now, whenever I call upon reticulate in R, it works, but after giving the error: “NameError: name ‘library’ is not defined”
I can use Python in R, but I’m unable to import any of the libraries that I installed, including pandas, numpy, etc. I installed those in Anaconda (though I used the “base” path when installing, as I didn’t understand the whole ‘virtual environment’ thing). Trying to import a library results in the following error:”
File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 122, in _find_and_load_hook return _run_hook(name, _hook) File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 96, in _run_hook module = hook() File " C:UsersJohnAppDataLocalRwin-library4.2reticulatepythonrpytoolsloader.py ", line 120, in _hook return _find_and_load(name, import_) ModuleNotFoundError: No module named 'pandas'
“Does anyone know of a resolution? Thanks in advance.
submitted by /u/Maleficent-Seesaw412
[link] [comments]