Getting the error message
ERROR: The requested version of Python
('~/.virtualenvs/python_environment/bin/python') cannot be used, as
another version of Python ('/usr/bin/python3') has already been
initialized. Please restart the R session if you need to attach
reticulate to a different version of Python.
Error in value[[3L]](cond) : 
  failed to initialize requested version of Python
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
In addition: Warning message:
In py_initialize(config$python, config$libpython, config$pythonhome,  :
  '.Random.seed[1]' is not a valid integer, so ignored
Execution halted
When loading my web app on shiny apps. The app only loads after I refresh the web page
Here is part of my code:
library(shinyWidgets)
library(tidyverse)
library(reticulate)
library(DT)
library(data.table)
virtualenv_create(envname = "python_environment",python="python3")
virtualenv_install("python_environment", packages =c('pandas','catboost'))
use_virtualenv("python_environment",required = TRUE)
                When you run library(reticulate), the reticulate package will try to initialize a version of Python, which may not be the version that you intend to use. To avoid this, (in a new R session) run your set-up commands without importing the full reticulate library with the :: syntax like this:
reticulate::virtualenv_create(envname = 'python_environment', 
                              python= 'python3')
reticulate::virtualenv_install("python_environment", 
                               packages=c('pandas','catboost'))
reticulate::use_virtualenv("python_environment",required = TRUE)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With