Requests library don't work on streamlit (403 error) but work properly locally

  1. Are you running your app locally or is it deployed?
    My app is deployed.
  2. If your app is deployed:
    a. It is deployed on Community Cloud.
    b. https://appapps-mrrus7hgqs3bdo3ehhrbtt.streamlit.app/
  3. The link to your appโ€™s public GitHub repository (including a requirements file).
  4. Full text of the error message:
    <Response [403]>
    But locally I have 200 and all looks good. Could you help please?
  5. I used in requirements without version assignment. So that should run with latest compatible versions or default streamlit compatible versions.

requests is working as expected and it is telling you what the response from the server is. It is probably blocking requests from the USA.

Okay, so do I need to make particular operation to get the response 200 Iโ€™m getting locally or switch to a different timezone?

If it is really geoblocking, I guess you could bypass it using an online proxy. But I have never done that, so I cannot advise you.