Closed Jfortin1 closed 4 years ago
I'll assume you're operating outside of a package context, given the lack of pkgname=
. I'll also assume you're operating on the latest basilisk, because I changed a few things (note that setupVirtualEnv
has become setupBasiliskEnv
, because Windows.)
If pkgname
is not supplied, basiliskStart()
(via useBasiliskEnv()
) will look for virtual environments in the current working directory. You can force it to not do this by setting the BASILISK_NONPKG_DIR
environment variable so that it looks somewhere else, e.g.,
Sys.setenv(BASILISK_NONPKG_DIR="/Users/fortinj/miniconda3/envs")
basiliskRun(envname="py2", fun) # no need to call `basiliskStart` directly in such a simple case.
Possibly this could be easier, but leaving pkgname=NULL
was not considered to be a major use case. Indeed, I only added it to simplify testing.
Works, thanks!
It should now be sufficient to pass in an absolute path to the environment.
I'd like to run code in the conda python2 virtual environment already set up on my machine.
I'm able to do that if I start my R session from the folder containing that environment, that is the following works:
results <- basiliskRun(basiliskStart("py2"), fun))
(where py2 is the name of my virtualenv) butresults <- basiliskRun(basiliskStart("/Users/fortinj/miniconda3/envs//py2"), fun))
won't work when started from elsewhere.It is easy to make it work?