Folium Static error while deploying

Hi,

I’m not able to deploy my app due to folium_static error. Please assist.

ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python <3.5; 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
ERROR: Could not find a version that satisfies the requirement folium_static (from versions: none)
ERROR: No matching distribution found for folium_static
Checking if Streamlit is installed
Found Streamlit version 1.34.0 in the environment

I added Python = 3.7 and then I get the below

Using standard pip install.
ERROR: Invalid requirement: 'Python =3.7' (from line 2 of /mount/src/uc-berkeley-ml-ai/Capstone-Project/requirements.txt)
Hint: = is not a valid operator. Did you mean == ?
Checking if Streamlit is installed
Found Streamlit version 1.34.0 in the environment

Hi @Deepa_Sarojam :wave:

You have a small syntax error in your requirements.txt. You should use == for specifying the Python version. Change the line from:

Python = 3.7

to:

python==3.7

Update your requirements.txt, try redeploying, and let me know :smiling_face:

Best,
Charly

1 Like

I don’t think you can specify a python version in requirements.txt. In streamlit cloud you choose the python version when creating the application.

1 Like

That’s true! Fixing this error wouldn’t have any impact when deploying to CCloud – Thanks for the reminder, @Goyo!

Now, I’m not sure if removing that line entirely from your requirements.txt would fix the issue you’re seeing, @Deepa_Sarojam. It may be worth trying.

It might also be a versioning conflict, or a typo with folium_static.

Charly

Thanks for the clarification @Charly_Wargnier . I’ll remove the Python from the requirements.txt and see if that helps.

Thanks @Goyo. Let me try and see.

1 Like

Nope, removing Python didn’t help.

ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python <3.5; 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
ERROR: Could not find a version that satisfies the requirement folium_static (from versions: none)
ERROR: No matching distribution found for folium_static
Checking if Streamlit is installed
Found Streamlit version 1.34.0 in the environment

This is no valid pypi package, it does not exist.
Please share a link to your public github repo.

1 Like

It did help with the ERROR: Invalid requirement: 'Python =3.7'. There seems to be other issues with your requirements file, though. Like folium_static, wich does not exist.

1 Like

This my repo - UC-Berkeley-ML-AI/Capstone-Project/eva_recommender.py at main · deepasarojam-2024/UC-Berkeley-ML-AI · GitHub

I was getting this error before and since it was mentioned that Python version doesn’t match, I went and added the version; and that didn’t go well :face_with_open_eyes_and_hand_over_mouth:

  1. remove folium_static
  2. do a reboot of the app

The folium map was not rendering otherwise, that when I used the folium_static. Any suggestions?

But adding streamlit_folium to requirements.txt didn’t help with that, did it? Worse, now the application doesn’t work at all. So better revert that and, if you still have issues, ask for help.

This was there. I removed folium_static.

1 Like

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