Is Connect Cloud able to install the `requests` Python library?

My Python Shiny project makes a request to an API, but when I tried to publish it on Posit Connect Cloud, I get:

ModuleNotFoundError: No module named 'requests'

My requirements.txt has requests==2.32.4

I have tried deploying with python 3.11 and 3.12.

The code also successfully loads the requests library locally, which makes me think that maybe it is not available on Posit Connect Cloud. Does anybody know?

For reference, here is my repo on GIthub: GitHub - canadian-municipal-barometer/llm-prototyping-webapp: A web app to interactively engineer LLM prompts.

Hi Reed,

I don't see requests in your requirements.txt file: llm-prototyping-webapp/requirements.txt at main · canadian-municipal-barometer/llm-prototyping-webapp · GitHub

Only:

shiny
seaborn
pandas
1 Like

hah, ok. I forgot to push the updated requirements.txt. Easy fix, but a bit embarassing! Thanks.

No worries. I'm glad it is working now!