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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.