Maybe it is the order. You called py_install() first and then called
use_condaenv(). Perhaps you need to switch to your conda env first and
then call py_install().

On 01/20/23 16:20, Kai Yang via R-help wrote:
Hi Team,I'm trying to run python in R markdown (flexdashboard). The code is 
below:

try Python=============
```{r, include=FALSE, echo=TRUE}library(reticulate)py_install("numpy")
use_condaenv("base")
```
```{python}import numpy as np```

I got error message below:
Error in py_call_impl(callable, dots$args, dots$keywords) :   ModuleNotFoundError: No module named 
'numpy'Calls: <Anonymous> ... py_capture_output -> force -> <Anonymous> -> 
py_call_implIn addition: There were 26 warnings (use warnings() to see them)Execution halted


Based on message, the python can not find numpy package. But I'm sure I 
installed the package. I don't know how to fix the problem. please help
Thank you,Kai

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to