It sounds like running your code locally could be unintentionally using your system Python (and its adtk package) rather than using your conda environment, which may be missing adtk and/or some of its modules.
When you run library(reticulate)
, the reticulate package will try to initialize its best-guess version of Python, which may not be the version that you intend to use. Since Python has already been initialized for your session, running use_condaenv('my_conda_env')
afterwards will likely be ignored. (You can test this by trying to run use_condaenv('my_conda_env', required = TRUE)
instead to see if you get an error similar to: The requested version of Python (<conda env python path>) cannot be used, as another version of Python (<system python path>) has already been initialized.
)
To force your code to run in your conda environment, restart your R session and run reticulate::use_condaenv('my_conda_env', required = TRUE)
. Confirm that the environment is being used by running reticulate::py_config()
.
You can double check that the correct version of adtk is installed in your conda env by viewing the installed packages. Finally, make sure that conda is supported on the system that you're running your Shiny app (conda isn't currently supported on shinyapps.io, for example, but you could use virtualenv instead.)