I am not sure if this is a posit connect server or pins issue, but I cannot get my shiny for python app to work on posit connect if the pins package is imported. Here is the minimum app to show this:
This app works and published without issue (it is the base example from the shiny documentation):
from shiny import App, ui # Part 1: ui ---- app_ui = ui.page_fluid( "Hello, world!", ) # Part 2: server ---- def server(input, output, session): ... # Combine into a shiny app. # Note that the variable must be "app". app = App(app_ui, server)
However, if I add the line "import pins" to the above (right below the from shiny import App,ui line), the app is able to deploy, but once deployed I get "An error has occured" with the following message in the logs:
Error while loading Python API: Could not import module 'app'. Connect expected to find a file in the application directory named 'app.py'. Please check the entrypoint specified in the manifest.json file or on the rsconnect-python command line. Reason: cannot import name 'hash_name' from 'fsspec.implementations.cached' (/opt/rstudio-connect/mnt/app/python/env/lib/python3.9/site-packages/fsspec/implementations/cached.py).
If I then remove the imports pin import and republish, the app starts working again.
As another note, I do not have any errors if I run either version locally.
The directory I am publishing from only contains app.py with the code mentioned above and a requirements.txt file with the requirements of shiny and pins.
The posit connect server I am publishing to is a corporate one, so I cannot share those details here. If you think it is a server issue rather than a pins issue, I will try to reach out to my corporate contacts, but I cannot find anything online about this, so figured I'd at least post it here to start.