Closed sreedta8 closed 7 months ago
There are a few ways:
WORKON_HOME
. This will change the default location that reticulate will use to create and search for virtual environments that are not absolute paths. You can set this system wide in "System Properties" -> "Advanced" (Tab) -> "Environment Variables" (Button) here:
Or you can set it a .Renviron file
WORKON_HOME=~/../.virtualenvs
E.g.,:
cat(sprintf("\nWORKON_HOME='%s'\n", normalizePath("~/../.virtualenvs", "/")),
file = "~/.Renviron", append = TRUE))
Or you can set it in a .Rprofile, or in an R session directly:
Sys.setenv(WORKON_HOME = "~/../.virtualenvs")
envname
argument in install_keras()
(and reticulate::py_install()
, virtualenv_create()
, etc.).
keras::install_keras(envname = "./.venv")
reticulate::use_virtualenv("./.venv")
@t-kalinowski Thank you!!!!! I know I cannot set through System Variables option. Good to know I can use multiple options to set via R
Hi
I'm experimenting with "reticulate" and tensorflow & keras ecosystem for the first time. I have used R for 20+ years and Python by itself via Anaconda, but not integrated the two together. One of the reasons, of course, is to use the DL tools such as TF and Keras from R. I would like to know how I can specify the creation of virtual environments in a location other than that what is chosen by default by the "install_keras()" function.
The problem I run into is that for some of my colleagues at work, the default is an online Documents folder (MS One Drive) and the virtual environments are being created online and there is no way to use any of the DL functionality as the constant error is "No TensorFlow installation found" or some to that effect. Could I control where the virtual env is created, say for example under, "c:/users/batman/.virtualenv/joker/"?