Deploy a streamlit app that requires a local python package installation

We're developing some algorithms and visualizations in a Python package, and as part of the package, we'd like to release a Streamlit app that demonstrates their usage in a no-code environment. Ideally we'd like to use Posit Connect Cloud.

A toy version of the app is here: GitHub - shapiromatron/streamlitpkg (with no algorithms, just the deployment details).

The package is structured like this:

.
├── pyproject.toml
├── requirements.txt
└── src
    └── streamlitpkg
        ├── __init__.py
        ├── app.py
        ├── cli.py
        └── work.py

To run locally, you run this command:

pip install -e .
streamlit run src/streamlitpkg/app.py

The requirements.txt just contains -e ., so it should install the package locally so imports work fine, but it fails in deployment:

2025-05-22T21:28:48-04:00 Error determining requirements: / does not appear to be a Python project, as neither `pyproject.toml` nor `setup.py` are present in the directory
2025-05-22T21:28:48-04:00 Failed to publish content: This content's dependencies could not be resolved. Check your requirements.txt. error_id=be682893-96d2-4b6f-b236-4dbbe1be8a31

Any idea how to fix? I tried moving the app file to the root outside of the package (not ideal), but that gave the same error.

Hi, thanks for the post. You've uncovered a couple of issues.

  1. Lack of support for pyproject.toml.
  2. Lack of support for editable mode (-e) with pip.
  3. Support a python root different than the primary file location.

We've discussed (1) and (3) before. (2) is new, so we've added an issue to explore that as well.

I was able to deploy your example with some hacks:

  1. Add typer and streamlit explicitly to requirements.txt (avoids issues #1/2)
  2. In app.py, change from streamlitpkg.work import super_add to from work import super_add so that it could find the function in work.py within the same directory (avoids issue #3)

Deployed example: https://alex-chisholm-streamlitpkg-test.share.connect.posit.cloud/

I know this isn't ideal, but your example is great for us to reevaluate how we support this type of deployment workflow - thanks!