Encounter Permission Error when my app install packages

Summary

My app utilize setup.py to install required packages. When I launch my app on Streamlit cloud it encounters permission error (could not install packages due to an OSError). It worked well on 28th July but it doesn’t now. Is there any critical changes on Streamlit Cloud?

Steps to reproduce

Code snippet:
In my app I utilized this code snippet for pip install from github.

import subprocess
import sys
import time
import streamlit as st
import pandas as pd

st.set_page_config(
    page_title="Elice TechOps Team Page",
    page_icon="👋"
)

try:
    import elice_techops

# This block executes only on the first run when your package isn't installed
except ModuleNotFoundError as e:
    sleep_time = 30
    dependency_warning = st.warning(
        f"Installing dependencies, this takes {sleep_time} seconds."
    )
    subprocess.Popen(
        [
            # f"{sys.executable} -m pip install git+https://${{github_token}}@github.com/sTomerG/streamlit_random_generator.git",
            f"{sys.executable} -m pip install git+https://${{github_token}}@github.com/kwanhong0130/Elice_TechOps.git",
        ],
        shell=True,
    )

    # wait for subprocess to install package before running your actual code below
    time.sleep(sleep_time)
    # remove the installing dependency warning
    dependency_warning.empty()

from loguru import logger

Debug info

  • Streamlit version: v.1.25.0
  • Python version: 3.9
  • Browser version: Chrome 115.0.5790.114

Requirements file (my setup.py)

import os

from setuptools import setup, find_packages


base_packages = ["numpy==1.24.2", "extra_streamlit_tools", 
                 "loguru==0.7.0", "openpyxl==3.1.1", "pandas==1.5.3",
                 "pytz==2023.2", "streamlit-aggrid==0.3.4.post3"]


def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()


setup(
    name="elice_techops",
    version="0.1.0",
    packages=find_packages(where="src"),
    package_dir={"": "src"},
    install_requires=base_packages,
    description="Random generator with streamlit front-end",
    author="Elice_TechOps_KwanHong",
    long_description=read("README.md"),
    long_description_content_type="text/markdown",
)

Hey @alan0130,

Sorry for the delayed response on this. When deploying your app on Streamlit Community Cloud, we actually recommend creating a pip-style requirements.txt file that follows the format outlined here.

Can you also share a link to your GitHub repo for the app so we can try to reproduce this issue?

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