Failed to deploy, dependency conflict

Hi community,

I am encountering issues when attempting to deploy my Streamlit application. The app runs perfectly in my local environment, but during deployment, I keep receiving errors that are difficult to comprehend.

Environment:

  • Streamlit Version: 1.38.0
  • Python Version: 3.11
  • Local Environment: The app works without any issues locally.
  • Database runs in Render

Steps to Reproduce:

  1. Set up a Streamlit app locally using streamlit==1.38.0 and Python 3.11.
  2. Deploy the app following standard deployment procedures for the chosen platform.
  3. Observe that the deployment fails with errors (logs attached if necessary).

Error Message:
[17:42:51] :desktop_computer: Provisioning machine…
[17:42:51] :control_knobs: Preparing system…
[17:42:51] :chains: Spinning up manager process…
[17:42:53] :rocket: Starting up repository: ‘overview_divi’, branch: ‘main’, main module: ‘streamlit_divi_new.py’
[17:42:53] :octopus: Cloning repository…
[17:42:54] :octopus: Cloning into ‘/mount/src/overview_divi’…
Warning: Permanently added the ED25519 host key for IP address ‘140.82.116.4’ to the list of known hosts.
[17:42:54] :octopus: Cloned repository!
[17:42:54] :octopus: Pulling code changes from Github…
[17:42:55] :package: Processing dependencies…

──────────────────────────────────────── uv ───────────────────────────────────────────
Using uv pip install.
× No solution found when resolving dependencies:
╰─▶ Because pywin32==306 has no wheels are available with a matching Python
implementation and you require pywin32==306, we can conclude that the
requirements are unsatisfiable.
Checking if Streamlit is installed
[17:43:11] :exclamation: installer returned a non-zero exit code
[17:43:11] :exclamation: Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
[17:44:43] :exclamation: Streamlit server consistently failed status checks
[17:44:43] :exclamation: Please fix the errors, push an update to the git repo, or reboot the app.

Expected Behavior: The app should deploy successfully without errors, as it functions correctly in the local environment.

Request for Assistance: I would appreciate any guidance on what could be causing these deployment issues. Are there known compatibility problems with this version of Streamlit or Python during deployment? Or could it be related to specific configurations required for deployment platforms?

Repo:

Thank you for your assistance.
Lubos

Why do you need pywin32?

I do not need it. It was not my intention to get pywin32. How can I get rid of it?

By not having it in the requirements file.

let me try

Thanks, I helped partially. I have a different error now (psycopg2 I think I need it):

Using uv pip install.
Resolved 95 packages in 215ms
error: Failed to download distributions
Caused by: Failed to fetch wheel: psycopg2==2.9.9
Caused by: Failed to build: psycopg2==2.9.9
Caused by: Build backend failed to determine extra requires with build_wheel() with exit status: 1
— stdout:
running egg_info
writing psycopg2.egg-info/PKG-INFO
writing dependency_links to psycopg2.egg-info/dependency_links.txt
writing top-level names to psycopg2.egg-info/top_level.txt
— stderr:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build …
or with the pg_config option in ‘setup.cfg’.
If you prefer to avoid building psycopg2 from source, please install the PyPI
‘psycopg2-binary’ package instead.
For further information please check the ‘doc/src/install.rst’ file (also at
https://www.psycopg.org/docs/install.html).

Checking if Streamlit is installed

At the end I have just this one:

[18:57:45] :exclamation: installer returned a non-zero exit code

Try psycopg2-binary instead. You’s better make sure you need it, you are advised to use psycopg for new code:

Please use the psycopg2 package if you are maintaining an existing program using psycopg2 as a dependency. If you are developing something new, Psycopg 3 is the most current implementation of the adapter.

1 Like

Hi Goyo,

I have generated the requirements.txt using pipreqs ./ it gave me the following modules:

altair==5.4.1
pandas==2.2.2
SQLAlchemy==2.0.34
streamlit==1.38.0

I failed to deploy again

ModuleNotFoundError: No module named 'psycopg2'

I tried to manually add into req file :

psycopg2-binary==2.9.9

and it works finally… thank you Goyo very much :pray: :pray: :pray:

Lubos

1 Like

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