Open jtelleriar opened 4 years ago
Also mention that I get an error when I try to manually start the IPython Terminal:
Sys.setenv(
RETICULATE_PYTHON = "C:/Users/J-tel/.conda/envs/conda_env_name/Scripts/ipython3.exe"
)
library(reticulate)
repl_python()
Error in py_initialize(config$python, config$libpython, config$pythonhome, : python37.dll - No se puede encontrar el módulo especificado.
:(
@kevinushey -- I cannot change the default repl to ipython on Windows. Is this an intended behavior?
IIRC, we don't yet support the use of an IPython interpreter from within reticulate
, but I believe @t-kalinowski has done some investigation here.
The REPL started by repl_python()
is implemented and provided by reticulate
directly, since we need to support some of R's idiosyncrasies in console input / output.
I did some investigations in this direction a while back. As part of that, there is an unexported proof-of-concept that you can use in the Terminal with reticulate.
# reticulate::py_install("IPython")
reticulate:::ipython()
Note that the above works as expected in a Terminal, but using it to drive the REPL in the RStudio IDE Console mostly doesn't work. There are just certain assumption that IPython makes about the terminal it's running in that are not true in the Console. Overall, we recommend using repl_python()
.
Note also that repl_python()
has support for some %magic
commands, similar to IPython. See ?repl_python
for details.
When using repl_python() for executing Python Code, it is executed by using a regular Python Interpreter, unless you specify a specific IPython Executable.
However, would it be possible to enable IPython Interpreter by default?
By doing so, users will be able to benefit for %magic commands, for example, in order to explore python variables which have been created through the %whos magic command.
Thanks!