Trouble installing lightfm==1.17 on Streamlit Cloud (Python 3.9)

Hi Streamlit Community,

I’m trying to deploy my music recommendation app on Streamlit Cloud, but I’m consistently running into an error during the dependency installation phase.

My application works perfectly on my local machine within a virtual environment using Python 3.10 and the specified library versions.

However, when deploying to Streamlit Cloud, the installation fails. I am currently deploying with Python 3.9 selected on Streamlit Cloud, as Python 3.10 also failed with a similar issue.

Here is the content of my requirements.txt file:

`# Please copy and paste the entire content of your requirements.txt file here.

It should be the version we finalized with lightfm==1.17, numpy==1.26.4, scipy==1.13.1, etc.`

The specific error messages I see in the Streamlit Cloud deployment logs are related to lightfm==1.17 failing to build:

`# Please copy and paste the relevant error section(s) from your Streamlit Cloud logs here.

Look for lines like:

“× Failed to download and build lightfm==1.17

“╰─▶ Build backend failed to determine requirements with build_wheel()

“AttributeError: ‘dict’ object has no attribute ‘LIGHTFM_SETUP’”

Include some lines before and after the main error for context.`

I have already tried:

  • Deploying with Python 3.10 (resulted in a similar build error for lightfm).
  • Adjusting numpy and scipy versions in requirements.txt to be compatible with Python 3.9, based on the logs.

Could anyone provide insight into why lightfm==1.17 might be failing to build in the Streamlit Cloud environment or suggest a specific workaround or compatible version combination?

Thank you for your time and help!

Best regards,

Indranil Bandyopadhyay