RStudio Workbench is telling RStudio Connect the wrong Python version when deploying a Jupyer Notebook using rsconnect CLI

Im unclear on how the rsconnect CLI determines which version of Python it tells RStudio Connect it needs to run a jupyter notebook. Im using the command below to deploy my_notebook.ipynb to RStudio Connect. it successfully uploads the bundle, "saves deployment data" but when its building the jupyter notebook in the next step (I assume on the RStudio Connect server) it failes because it cannot find a "compatible environment" (i.e. Python version). Its looking for Python 3.7.10 but my notebook was written in 3.9.2. I have 3.9.2 in the RStudio connect config file and Python is enabled but for whatever reason Rstudio workbench is telling RStudio Connect I need 3.7.10. Even looking at the notebook without rendering it says Python 3.9.2 is being used so Im a little confused where Workbench is getting 3.7.10 from. Any ideas on this or documentation?

rsconnect deploy notebook --server https://blah.com --api-key ... my_notebook.ipynb

Deployment log is below...

Checking arguments... [OK]
Deploying my_notebook.ipynb to server "https://blah.com"
Inspecting Python environment... [OK]
Creating deployment bundle... [OK]
Uploading bundle... [OK]
Saving deployment data... [OK]

Deployment log:
Building Jupyter notebook...
Cannot find compatible environment: no compatible Local environment with Python version 3.7.10

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Woops! Apologies for missing your message here! I hope you got to the bottom of the issue!

It sounds like the version of Python on RStudio Connect was not "active." There are several reasons this could be, but you can always see all available versions that Connect is aware of on the "Documentation" page!

A handful of reasons to keep in mind:

  • Connect has to be restarted after adding python versions
  • if virtualenv or setuptools is missing from the python installation, it might get bypassed
  • if there is a problem using / loading the python version, there should be an error / log message, so my bet is on the first bullet / you were in need of a restart!

These types of issues are definitely addressable to our professional support team, though! So in the future, emailing support@rstudio.com might be a safer bet, in case we miss the issue here :sweat_smile: Hope that helps!