I am getting this error when I am trying to deploy my ML model on streamlit however it runs perfectly normal on my local host. It seems to be some issue with the lottie file.
I have included a requirements.txt file but still am getting issues to deploy.
hi ! can you describe how your are importing lottlie files? in JSON format form path or fetching it form URL
if you are using JSON input the method needs path to be defined
from streamlit_lottie import st_lottie
with open("tree-in-the-wind.json", "r") as f:
data = json.load(f)
st_lottie(data)
it may cause dude to directory error in lottlie file import at streamlit cloud, at your requirement.txt might be missing with dependency of lottlie to import which makes lottlie work.
as per st_lottlie it depends on this few import includes
pip install setuptools wheel twine
this help lottlie to build setup it imports.
as if could you please update your post ? with your github repo or deploy link !
Hey thanks for replying!
This is my lottie file inclusion code->
def load_lottiefile(filepath:str):
with open(filepath,“r”) as f:
return json.load(f)
lottie_coding=load_lottiefile(“C:\Users\srish\Desktop\ML Projects\Breast Cancer Detection\animation_ln4fa54w.json”)
st_lottie(
lottie_coding,
speed=1,
reverse=False,
loop=True,
quality=“high”,
# renderer=“svg”,
height=“200px”,
width=“300px”,
key=None,
)
I have commented my github repo link above, in case you have time please do check it out
thank you :))
hello yes, i unfortunately overlooked this url part.
i changed my code. its working well. thanks @inline-arc
i edited my code following your reply.
all issues have been resolved.
thank you to everyone who replied to this thread.