Streamlit deployment error: trying first time

If you’re creating a debugging post, please include the following info:

github repo:
DataScience-MachineLearning-Projects/Resume Classifier at main · AfreenInnovates/DataScience-MachineLearning-Projects (github.com)

error:

[     UTC     ] Logs for classify-resume.streamlit.app/
────────────────────────────────────────────────────────────────────────────────────────
[10:04:08] 🚀 Starting up repository: 'datascience-machinelearning-projects', branch: 'main', main module: 'Resume Classifier/app.py'
[10:04:08] 🐙 Cloning repository...
[10:04:11] 🐙 Cloning into '/mount/src/datascience-machinelearning-projects'...
[10:04:12] 🐙 Cloned repository!
[10:04:12] 🐙 Pulling code changes from Github...
[10:04:13] 📦 Processing dependencies...

──────────────────────────────────────── uv ───────────────────────────────────────────

Using uv pip install.
error: failed to read from file `/mount/src/datascience-machinelearning-projects/Resume`
  Caused by: No such file or directory (os error 2)
Checking if Streamlit is installed

────────────────────────────────────────────────────────────────────────────────────────


──────────────────────────────────────── pip ───────────────────────────────────────────

Using standard pip install.
ERROR: Invalid requirement: 'Classifier/requirements.txt'
Hint: It looks like a path. File 'Classifier/requirements.txt' does not exist.

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
Checking if Streamlit is installed

────────────────────────────────────────────────────────────────────────────────────────

[10:04:16] ❗️ installer returned a non-zero exit code
[10:04:16] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

From the logs, it looks like “Resume Classifier” is causing a problem with the space.

Can you try deleting your app, updating the folder name to “Resume-Classifier”, then deploying your app again? (Community Cloud can’t handle changes to the entrypoint file path, so that’s why delete first. )

well, thank you. that removed that error, now it shows this:

[     UTC     ] Logs for classify-resume.streamlit.app/
────────────────────────────────────────────────────────────────────────────────────────
[10:50:32] 🖥 Provisioning machine...
[10:50:32] 🎛 Preparing system...
[10:50:32] ⛓ Spinning up manager process...
[10:50:42] 🚀 Starting up repository: 'datascience-machinelearning-projects', branch: 'main', main module: 'Resume-Classifier/app.py'
[10:50:42] 🐙 Cloning repository...
[10:50:46] 🐙 Cloning into '/mount/src/datascience-machinelearning-projects'...
[10:50:46] 🐙 Cloned repository!
[10:50:46] 🐙 Pulling code changes from Github...
[10:50:47] 📦 Processing dependencies...
Check if streamlit is installed
cat: /mount/admin/install_path: No such file or directory[2024-10-08 10:50:47.464881] 

──────────────────────────────── Installing Streamlit ──────────────────────────────────

Using uv pip install.
Resolved 41 packages in 350ms
Downloaded 41 packages in 1.67s
Installed 41 packages in 84ms
 +[2024-10-08 10:50:49.658119]  altair==5.4.1
 + attrs==24.2.0
 + blinker==1.8.2
 + cachetools==5.5.0
 + certifi==2024.8.30
 + charset-normalizer==3.3.2
 + click==8.1.7
 + gitdb==4.0.11
 + gitpython==3.1.43
 + idna==3.10
 + jinja2==3.1.4
 + jsonschema==4.23.0
 + jsonschema-specifications==2023.12.1
 + markdown-it-py==3.0.0
 + markupsafe==3.0.0
 + mdurl==0.1.2
 + narwhals==1.9.1
 + numpy==2.1.2
 + [2024-10-08 10:50:49.658342] packaging==24.1
 + pandas==2.2.3
 + pillow==10.4.0
 + protobuf==5.28.2
 + pyarrow==17.0.0
 + pydeck==0.9.1
 + pygments==2.18.0
 + python-dateutil==2.9.0.post0
 + pytz==2024.2
 + referencing==0.35.1
 + [2024-10-08 10:50:49.658513] requests==2.32.3
 + rich==13.9.2
 + rpds-py==0.20.0
 + six==1.16.0
 + smmap==5.0.1
 + streamlit==1.39.0
 + tenacity==9.0.0
 + toml==0.10.2
 + tornado==6.4.1
 + typing-extensions==4.12.2
 + tzdata==2024.2
 + urllib3==2.2.3
 + watchdog==5.0.3

────────────────────────────────────────────────────────────────────────────────────────

[10:50:50] 📦 Processed dependencies!
cat: /mount/admin/install_path: No such file or directory



/mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:29: SyntaxWarning: invalid escape sequence '\S'
  clean_text = re.sub('http\S+\s', ' ', txt)
/mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:31: SyntaxWarning: invalid escape sequence '\S'
  clean_text = re.sub('#\S+\s', ' ', clean_text)
/mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:32: SyntaxWarning: invalid escape sequence '\S'
  clean_text = re.sub('@\S+', '  ', clean_text)
/mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:33: SyntaxWarning: invalid escape sequence '\]'
  clean_text = re.sub('[%s]' % re.escape("""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""), ' ', clean_text)
/mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:35: SyntaxWarning: invalid escape sequence '\s'
  clean_text = re.sub('\s+', ' ', clean_text)
────────────────────── Traceback (most recent call last) ───────────────────────
  /home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptru  
  nner/exec_code.py:88 in exec_func_with_error_handling                         
                                                                                
  /home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptru  
  nner/script_runner.py:579 in code_to_exec                                     
                                                                                
  /mount/src/datascience-machinelearning-projects/Resume-Classifier/app.py:4    
  in <module>                                                                   
                                                                                
     1 import streamlit as st                                                   
     2 import pickle                                                            
     3 import re                                                                
  ❱  4 import PyPDF2  # For extracting text from PDFs                           
     5                                                                          
     6 # Load the pre-trained models and vectorizers                            
     7 knn_model_cv = pickle.load(open("knn_model_cv.pkl", "rb"))               
────────────────────────────────────────────────────────────────────────────────
ModuleNotFoundError: No module named 'PyPDF2'

do i make a requirements.txt file in the new folder that i created?

First, if you edit your posts and surround your logs with triple backticks, that will correctly format your logs in a codeblock so they’re readable. :smile:

One of our engineers also replied to me internally and it looks like they’ve added the space handling to their bug list, so thanks for reporting.

As for the next error, I do see PyPDF2 in your requirements file, so I’m a little stumped. I’m not seeing anything in the documentation about more complicated installation requirements for it, either. :confused:

Do I try to remove the requirements.txt file and try again?

Any suggestions as to what I could do to fix this?

Thanks for your time,
Afreen

Since the requirement was there before you deployed, rebooting shouldn’t matter, but you can try.

You could try moving PyPDF2 to the end of file (although that shouldn’t matter), or try including a version pin for it…

yep, same error. Not sure what’'s wrong :face_holding_back_tears:

I forked your repo, tried to deploy the app and got this:

Using uv pip install.
Resolved 47 packages in 1.39s
error: Failed to download distributions
  Caused by: Failed to fetch wheel: pickle5==0.0.11
  Caused by: Failed to build: `pickle5==0.0.11`
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1

pickle5 has been unmaintained for a long time, and it would be hard (if possible at all) to make it work in streamlit cloud, but all their features should be available in recent python. Do you really need it?

I don’t think so. But how else would I save the model? Any alternate code you could provide?

The pickle module in the standard library. See the description in pickle5’ s pypi page.

So, shall I use pickle?

That’s what I used when I first saved the model. Can u check my requirements.txt file now?

Probably.

Not sure what you expect me to check. As it seems you are no longer installing PyPDF2 and scikit-learn, which at first sight doesn’t make sense to me.

Hello!!!

I think I’ve figured out what the mistake was!

Today, I managed to deploy another project successfully. I realized that it needed the path of the actual file on the GitHub repository, not the path on my local machine. I think if I make the same change on the resume classifier project, it should work!

That is likely true, but I don’t think it is related to the errors you posted here.

Hello,

Actually, I think that was the error. I changed the paths to the paths how it is on GitHub, and also included PyPDF2 in the requirements.txt file.

Check out the website here: https://classify-resume.streamlit.app/