Уценка R с помощью python/reticulate – нет модуля с именем pandasPython

Программы на Python
Anonymous
Уценка R с помощью python/reticulate – нет модуля с именем pandas

Сообщение Anonymous »

Я получаю ошибку ModuleNotFoundError для pandas сразу после того, как мне сообщили, что pandas установлена.
Вот упрощенный код, показывающий проблему.

Код: Выделить всё

{r echo=FALSE, include=FALSE}
knitr::opts_chunk$set(engine.path=list(python='/mnt/c/Users/steve/workspace/EDGI/EEW-ReportCard-Data/venv/bin/python'))
library(reticulate)
virtualenv_create('venv')
py_install('pandas', envname='venv')

u  knitr::opts_chunk$set(engine.path=list(python='/mnt/c/Users/steve/workspace/EDGI/EEW-ReportCard-Data/venv/bin/python'))
library(reticulate)
virtualenv_create('venv')
py_install('pandas', envname='venv')

u  library(reticulate)
> virtualenv_create('venv')
virtualenv: venv
> py_install('pandas', envname='venv')
Using virtual environment 'venv' ...
+ /home/steve/.virtualenvs/venv/bin/python -m pip install --upgrade --no-user pandas
Requirement already satisfied: pandas in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (2.0.3)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (from pandas) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (from pandas) (2024.1)
Requirement already satisfied: tzdata>=2022.1 in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (from pandas) (2024.1)
Requirement already satisfied: numpy>=1.20.3 in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (from pandas) (1.24.4)
Requirement already satisfied: six>=1.5 in /home/steve/.virtualenvs/venv/lib/python3.8/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
>
> u 

Подробнее здесь: [url]https://stackoverflow.com/questions/78388357/r-markdown-with-python-reticulate-no-module-named-pandas[/url]

Вернуться в «Python»