Installing packages for app deployment

Hello,

I am a newbie, and this is my first time deploying an app using Streamlit.
When I was testing my code with Google Colab and wanted to install packages, I could just simply use !pip, but I am not sure how to install them when I am trying to deploy the app.

I looked up some of the posts but am still confused. What I have currently is the following:

I made a ‘requirements.txt’ file and put the name of the packages that I want to install.

openai
langchain
unstructured
poppler-utils
pinecone-client
tiktoken
streamlit
pyngrok
git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2

The !pip commands I had in my colab were the following:

# Install required libraries
!pip install openai
!pip install langchain
!pip install --upgrade langchain openai -q
!pip install unstructured -q
!pip install "detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2" -q
!pip install poppler-utils -q
!pip install pinecone-client -q
!pip install tiktoken -q
!pip install streamlit
!pip install "pydantic<2"
!pip install "trubrics[streamlit]"
!pip install pyngrok

Am I doing my package installation correctly? Thank you in advance!

Hi @barky, welcome to the forum!

Yes, that looks correct to me, if you are using Community Cloud to deploy your app.
See App dependencies - Streamlit Docs for more details.

You might run into some issues with detectron2 – if you do, you may find posts like this helpful Error when using Streamlit Cloud [Detectron2] - #2 by Nabil-Miri

1 Like

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