6

When using reticulate package in order to use Python inside R, we can create a virtualenv thanks to the command reticulate::virtualenv_create specifying env name and the path to the python bin.

We can also add packages to the previously created environment like this:

  reticulate::virtualenv_create(envname = 'venv_shiny_app',
                                 python = '/usr/bin/python3')
  reticulate::virtualenv_install('venv_shiny_app',
                                 packages = c('numpy',
                                              'xlrd',
                                              'pandas',
                                              'beautifulsoup4',
                                              'joblib'))

Is it possible to install a specific version of those packages??

Thanks

Marco Fumagalli
  • 2,307
  • 3
  • 23
  • 41

1 Answers1

9

You can request a specific version of a package with, for example:

reticulate::virtualenv_install(packages = c("numpy==1.8.0"))

Kevin Ushey
  • 20,530
  • 5
  • 56
  • 88