Skip to contents
library(kwb.python)
env_name <- "test"
kwb.python::conda_py_install(env_name = env_name, 
                             pkgs = list(conda = "python",
                                         py = NULL)
                             )
#> * Installing Miniconda -- please wait a moment ...
#> * Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
#> + "C:/Users/runneradmin/AppData/Local/r-miniconda/condabin/conda.bat" "create" "--yes" "--name" "r-reticulate" "python=3.8" "numpy" "--quiet" "-c" "conda-forge"
#> * Miniconda has been successfully installed at "C:/Users/runneradmin/AppData/Local/r-miniconda".
#> + "C:/Users/runneradmin/AppData/Local/r-miniconda/condabin/conda.bat" "create" "--yes" "--name" "test" "python" "--quiet" "-c" "conda-forge"
#> + "C:/Users/runneradmin/AppData/Local/r-miniconda/condabin/conda.bat" "install" "--yes" "--name" "test" "-c" "conda-forge" "python"
#> python:         C:/Users/runneradmin/AppData/Local/r-miniconda/envs/test/python.exe
#> libpython:      C:/Users/runneradmin/AppData/Local/r-miniconda/envs/test/python310.dll
#> pythonhome:     C:/Users/runneradmin/AppData/Local/r-miniconda/envs/test
#> version:        3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:32:50) [MSC v.1929 64 bit (AMD64)]
#> Architecture:   64bit
#> numpy:           [NOT FOUND]
#> 
#> NOTE: Python version was forced by use_python function

path_environment_yml <- kwb.python::conda_export(condaenv = env_name)
path_environment_yml
#> [1] "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\RtmpkRXLH7/environment_test.yml"
cat(paste0(readLines(path_environment_yml), collapse = "\n"))
#> name: test
#> channels:
#>   - conda-forge
#>   - defaults
#> dependencies:
#>   - bzip2=1.0.8=h8ffe710_4
#>   - ca-certificates=2022.5.18.1=h5b45459_0
#>   - libffi=3.4.2=h8ffe710_5
#>   - libzlib=1.2.11=h8ffe710_1014
#>   - openssl=3.0.3=h8ffe710_0
#>   - pip=22.1.1=pyhd8ed1ab_0
#>   - python=3.10.4=hcf16a7b_0_cpython
#>   - python_abi=3.10=2_cp310
#>   - setuptools=62.3.2=py310h5588dad_0
#>   - sqlite=3.38.5=h8ffe710_0
#>   - tk=8.6.12=h8ffe710_0
#>   - tzdata=2022a=h191b570_0
#>   - ucrt=10.0.20348.0=h57928b3_0
#>   - vc=14.2=hb210afc_6
#>   - vs2015_runtime=14.29.30037=h902a5da_6
#>   - wheel=0.37.1=pyhd8ed1ab_0
#>   - xz=5.2.5=h62dcd97_1
#> prefix: C:\Users\runneradmin\AppData\Local\r-miniconda\envs\test