Unexpected Pywin error in deployment

Hello – I have been totally stuck for a few hours and am seeking assistance.

I am trying to deploy my streamlit app but am having difficulties due to unexpected errors during the requirements.txt installation.

I am deploying from a Windows 10 machine, and saw questions like this one about ensuring that the requirements.txt file does not include Windows specific paths.

Full error:

ERROR: Could not find a version that satisfies the requirement pywin32==304 (from versions: none)

ERROR: No matching distribution found for pywin32==304

WARNING: You are using pip version 22.0.3; however, version 22.2.2 is available.

You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.

Checking if Streamlit is installed

[02:35:17] ❗️ installer returned a non-zero exit code

[02:35:17] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

[02:36:54] ❗️ Streamlit server consistently failed status checks

[02:36:54] ❗️ Please fix the errors, push an update to the git repo, or reboot the app.

The requirements.txt file is copied below:

altair==4.2.0

attrs==22.1.0

blinker==1.5

cachetools==5.2.0

certifi==2022.6.15

charset-normalizer==2.1.1

click==8.1.3

colorama==0.4.5

commonmark==0.9.1

cycler==0.11.0

decorator==5.1.1

entrypoints==0.4

fonttools==4.37.1

gitdb==4.0.9

GitPython==3.1.27

idna==3.3

importlib-metadata==4.12.0

Jinja2==3.1.2

joblib==1.1.0

jsonschema==4.14.0

kiwisolver==1.4.4

llvmlite==0.39.0

MarkupSafe==2.1.1

matplotlib==3.5.3

numba==0.56.0

numpy==1.22.4

packaging==21.3

pandas==1.4.3

Pillow==9.2.0

plotly==5.10.0

protobuf==3.20.1

pyarrow==9.0.0

pydeck==0.8.0b1

Pygments==2.13.0

Pympler==1.0.1

pynndescent==0.5.7

pyparsing==3.0.9

pyrsistent==0.18.1

python-dateutil==2.8.2

pytz==2022.2.1

pytz-deprecation-shim==0.1.0.post0

requests==2.28.1

rich==12.5.1

scikit-learn==1.1.2

scipy==1.9.1

seaborn==0.11.2

semver==2.13.0

six==1.16.0

smmap==5.0.0

streamlit==1.12.2

tenacity==8.0.1

threadpoolctl==3.1.0

toml==0.10.2

toolz==0.12.0

tornado==6.2

tqdm==4.64.0

typing_extensions==4.3.0

tzdata==2022.2

tzlocal==4.2

umap-learn==0.5.3

urllib3==1.26.12

validators==0.20.0

watchdog==2.1.9

zipp==3.8.1

My questions are:

  1. Why is pywin throwing an error? I can recreate this in my Debian environment locally, and in my Windows environment
  2. How can I access the terminal of the deployment machine myself to debug?

I thank you in advance for your assistance.

Hi @Tony-BigDataVisions, welcome to the community! :wave:

pywin32 is throwing an error because it is unable to find compatible wheel file for Debian. pywin32 only releases wheels for Windows. The pywin32 module provides access to many of the Windows APIs from Python. Apps deployed to Streamlit Cloud are executed in a Linux environment. As such, pywin32 fails to install on non-Windows systems, including Streamlit Cloud. If you remove pywin32==304 from your requirements.txt, this error should no longer be thrown.

I’m curious about how you’re able to “recreate” a pywin32 install on Debian when there doesn’t exist an installation candidate. :thinking:

When you’re viewing your app as a developer, you can click on the bottom right where it says “Manage app” to view your Cloud logs and other settings: Manage your app - Streamlit Docs

Note however that you don’t have terminal access to the container your app is running in. Just read-only logs of stdout.

pywin32 is a Windows-only package: pyWin32 for linux OS · Issue #1449 · mhammond/pywin32 · GitHub

Ahh, thanks.
I should clarify what I was saying –

I was able to spin up a Debian-based VM (Ubuntu 20.04.4). I had initially used poetry for package management and was able to install those packages through pip. Sorry if my troubleshooting steps were unclear!

As for seeing things through developer – I saw the stdout printouts, but wasn’t sure if I could access the terminal directly. I didn’t see anything stating I could in documentation, but wasn’t sure. I appreciate your clarification!

Lastly – I’m sorry if this is a waste of your time or a Python specific thing @snehankekre , I don’t see pywin explicitly listed in the requirements.txt, unless I am going crazy (which I very well maybe), as I initially thought to just remove it, but I don’t see it.

1 Like

I don’t see pywin explicitly listed in the requirements.txt

You’re right, I missed that on first pass. :confused:

Take a look at a repo and ephemeral app I created using your requirements file. I’m unable to reproduce the pywin-related error on my end. I thought it could be a dependency of a dependency, but it doesn’t seem to be the case.

Could you share a link to your repo so we could take a look and debug? I’d be surprised if you’re getting the error with the requirements you’ve posted here.

The above log seems to indicate that a pinned pywin32==304 exists in requirements.txt

The first thing I’d try is to verify that pywin32 doesn’t exist somewhere in the requirements file. Then I’d try deleting and redeploying the app on Streamlit Cloud.

1 Like

I feel very embarrassed. You are right – the requirements.txt in the repository did not match what I included here. I didn’t push my changes. Sigh, I apologize for wasting your time, but I do appreciate you answering!

App is officially in the oven :slight_smile:

1 Like

No worries! Hopefully we were able to resolve the issue.

1 Like

While building docker image… I got this error. I have checked Docker and requirements.txt files … But i didn’t find any pywin dependencies. But it still gives me the error

could not find a version that satisfies the requirement pywin32==303
no matching distribution found for pywin32==303

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