Install a particular version of python package in a virtualenv created with reticulate
Asked Answered
O

1

7

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

Oospore answered 27/3, 2020 at 8:49 Comment(0)
S
10

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

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

Scorpion answered 27/3, 2020 at 20:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.