ERROR! ERROR: No matching distribution found for distutils

I am new to Streamlit trying to deploy an application but I am getting an error

This is my requirements.txt file in python
asttokens==2.2.1

backcall==0.2.0

beautifulsoup4==4.11.2

blinker==1.8.2

certifi==2022.12.7

charset-normalizer==3.0.1

click==8.1.7

colorama==0.4.6

comm==0.1.2

contourpy==1.0.7

cycler==0.11.0

debugpy==1.6.4

decorator==5.1.1

entrypoints==0.4

et-xmlfile==1.1.0

executing==1.2.0

filelock==3.16.1

Flask==3.0.3

fonttools==4.38.0

fsspec==2024.9.0

google==3.0.0

greenlet==2.0.2

huggingface-hub==0.25.1

idna==3.4

ipykernel==6.19.4

ipython==8.7.0

itsdangerous==2.2.0

jedi==0.18.2

Jinja2==3.1.4

joblib==1.4.2

jupyter_client==7.4.8

jupyter_core==5.1.2

kiwisolver==1.4.4

lxml==5.3.0

MarkupSafe==2.1.5

matplotlib==3.9.2

matplotlib-inline==0.1.6

mpmath==1.3.0

mysql-connector-python==8.0.31

nest-asyncio==1.5.6

networkx==3.3

numpy==2.0

openpyxl==3.0.10

packaging==22.0

pandas==1.5.2

parso==0.8.3

pickleshare==0.7.5

Pillow==9.4.0

pinecone-client==5.0.1

pinecone-plugin-inference==1.1.0

pinecone-plugin-interface==0.0.7

platformdirs==2.6.2

prompt-toolkit==3.0.36

protobuf==3.20.1

psutil==5.9.4

psycopg2-binary==2.9.9

pure-eval==0.2.2

Pygments==2.14.0

pyparsing==3.0.9

python-dateutil==2.8.2

python-pptx==1.0.2

pytz==2022.7

#pywin32==305

PyYAML==6.0.2

pyzmq==24.0.1

regex==2024.9.11

requests==2.28.2

safetensors==0.4.5

scikit-learn==1.5.2

scipy==1.14.1

sentence-transformers==3.1.1

six==1.16.0

soupsieve==2.3.2.post1

SQLAlchemy==2.0.0

stack-data==0.6.2

sympy==1.13.3

threadpoolctl==3.5.0

tokenizers==0.20.0

torch==2.4.1

tornado==6.2

tqdm==4.66.5

traitlets==5.8.0

transformers==4.45.1

typing_extensions==4.12.2

urllib3==1.26.14

wcwidth==0.2.5

Werkzeug==3.0.4

xlrd==2.0.1

XlsxWriter==3.2.0

xlwt==1.3.0

setuptools>=75.1.0

python==3.9

I would go through and try to minimize your dependencies down to the very minimal list. It looks like you have a lot of things that are probably irrelevant to your streamlit app, like jupyter, and everything is pinned to specific versions. See if you can go through and see what packages your app actually imports, and just list those in your requirements.txt. Also, unless you know that you need a specific version of a package, just leave the package name by itself, without any == – this will allow the solver to try and find a set of packages which are compatible.

Also, you shouldn’t have python in requirements.txt

okay I will cut down on the requirements part, lets see what comes up

This often happens when you try to install an old version of some package with a recent version of python. Unfortunately your screenshot doesn’t include some relevant parts of the logs (that’s why screenshots are not a good way of posting textual information), so we don’t know what is the package causing the issue.

Okay now I have all the requirements

Streamlit - for the UI

streamlit==1.23.1

Pandas - for data handling

pandas==1.5.2

Transformers - for AI model handling

transformers==4.45.1

Huggingface Hub - necessary for transformers

huggingface-hub==0.25.1

Pinecone - for embedding and vector search

pinecone-client==5.0.1

pinecone-plugin-inference==1.1.0

Flask - if necessary for APIs

Flask==3.0.3

Werkzeug==3.0.4

Numpy - numerical operations

numpy==1.24.0

scikit-learn - used for additional data processing (if needed)

scikit-learn==1.5.2

tqdm - for progress bars (if needed in data/model processing)

tqdm==4.66.5

Additional essential utilities

requests==2.28.2

Now it is again giving me distutils issues
No Module named: distutils

import distutils.core
ModuleNotFoundError: No module named ‘distutils’

I would still try to trim that down a lot more, and remove the specific version numbers as much as possible.

Since you’re just using a streamlit app, you can’t actually use Flask or Werkzeug, so I would drop those. I would also remove numpy, requests and pandas, since they are included streamlit streamlit.

I would also remove all the “If needed” packages, and add those back later if you do end up needing them.

Your requirements might be as simple as this:

streamlit
transformers
huggingface-hub
pinecone-client
pinecone-plugin-inference

If you know that you need a specific version of one or more of those, you could try specifying that version, but it will be easier for the solver if you only pin (meaning ==specific.version.number) a minimal number of dependencies.