Issue while deploying in the streamlit server

I am having issue in deploying in the streamlit cloud server, where as I am able to deploy it locally successfully.

Streamlit

Git : pcbhanjdeo08/CancerPredictor

Hey, thanks for sharing your question and welcome to the Streamlit community! :balloon: This is a super common scenario—your app works locally but fails on Streamlit Community Cloud. The most frequent causes are:

  1. Dependency issues: Make sure every library you import in your code is listed in your requirements.txt file, and that the file is named exactly requirements.txt (all lowercase). Also, avoid including standard library modules (like base64 or json) in this file, as they’re built into Python and will cause errors if listed. Pinning exact versions (e.g., scikit-learn==1.3.2) helps prevent version mismatches between local and cloud environments.
  2. File paths and data: If your code references files using absolute paths (like C:\Users\...), update them to use relative paths and ensure those files are included in your GitHub repo. The cloud server can’t access files on your local machine.

For more troubleshooting, check the deployment logs in the “Manage app” section on Streamlit Cloud. If you see errors like “Error installing requirements,” it usually means a missing or misspelled package in requirements.txt, or a package that isn’t supported on Linux (the OS used by Streamlit Cloud). For example, use scikit-learn (not sklearn) in your requirements file.
See the official docs for app dependencies and common deployment issues.

If you’re still stuck, please share your requirements.txt and any error messages from the deployment logs. A minimum reproducible example or a link to your repo (which you’ve provided—thanks!) helps the community help you faster. Folks, feel free to jump in with your insights or similar experiences!

Sources: