[R] reticulate + virtual environments

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Mon Jul 15 17:26:56 CEST 2024


В Mon, 15 Jul 2024 07:56:17 +0200
Sigbert Klinke <sigbert using wiwi.hu-berlin.de> пишет:

>  > py_config()  

>  > use_virtualenv("mmstat4.hu.data", required = TRUE)  

Does it help _not_ to call py_config() before use_virtualenv()?

help(py_config) says that it forces the initialization of Python. When
you later try to ask for a different virtual environment, no conflict
is detected because
normalizePath('/home/sk/.virtualenvs/r-reticulate/bin/python') is
identical to
normalizePath('/home/sk/.virtualenvs/mmstat4.hu.data/bin/python'): they
must be both symlinks to /usr/bin/python3, so reticulate is likely
thinking that it's the same Python. Thus Python is not initialised
again, but you also don't see an error.

-- 
Best regards,
Ivan



More information about the R-help mailing list