How to set PATH and environment variables in the web app cloud?

Hi i am trying to deploy a streamlit app but it is giving me an error since i have to set “poppler” in path apparently to use the pdf2image library. any way to do this?

Hi @zappy586

You can set environment variables using something like the following in your file.

import streamlit as st
import os

# Set the path as environment variable
os.environ['PATH'] = '/path/to/dir/'

Additionally, you can also use Streamlit’s secrets as well. More info here:

Set on Streamlit Community Cloud, then to use in app:


Hope this helps!

Best regards,

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