| init_py_env | R Documentation |
py_requireInitialize the required Python environment with the required modules, using procedures introduced in reticulate 1.42.0.
init_py_env(
cuda=FALSE, test_cuda=cuda, test_dynamo=TRUE, force=FALSE,
test_torch=test_cuda || test_dynamo,
verbose=interactive())
cuda |
Boolean: Whether to install cuda device (only needed once). |
test_cuda |
Boolean: whether to test that cuda device can be used. |
test_dynamo |
Boolean: whether to test that |
test_torch |
Boolean: whether to test that |
force |
Boolean: Whether to force re-installation of miniconda. |
verbose |
Boolean: Whether to reprot progress of the different steps of the procedure. |
The the attempt to import the "torch._dynamo" module may fail on linux with message
ImportError: cannot import name 'NP_SUPPORTED_MODULES' from 'torch._dynamo.utils'.
If so, seek the libstdc++ library in the r-reticulate architecture (something like
/home/<MY_USER_NAME>/.local/share/r-miniconda/lib/libstdc++.so.6.0.29),
and either create a symbolic link to it
as libstdc++.so.6 in (likely path) /usr/lib/x86_64-linux-gnu/,
or change the PATH variable:
export LD_LIBRARY_PATH=/home/<MY_USER_NAME>/.local/share/r-miniconda/lib/:$LD_LIBRARY_PATH.
On the WSL, I found that the symbolic link is overwritten each time the WSL is restarted.
Returns NULL invisibly.
get_py_MAF_handle
# See help("get_py_MAF_handle") for basic usage
# The following test may be useful in broader contexts:
## Not run: # too slow for CRAN checks
if ( ! reticulate::py_available(initialize = FALSE)) init_py_env(test_cuda=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.