Last active
July 20, 2024 10:31
-
-
Save Sven-Bo/31d98f80b5fed1d3f53cf98e5b61e7c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests # pip install requests | |
import streamlit as st # pip install streamlit | |
from streamlit_lottie import st_lottie # pip install streamlit-lottie | |
# GitHub: https://github.com/andfanilo/streamlit-lottie | |
# Lottie Files: https://lottiefiles.com/ | |
def load_lottiefile(filepath: str): | |
with open(filepath, "r") as f: | |
return json.load(f) | |
def load_lottieurl(url: str): | |
r = requests.get(url) | |
if r.status_code != 200: | |
return None | |
return r.json() | |
lottie_coding = load_lottiefile("lottiefile.json") # replace link to local lottie file | |
lottie_hello = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_M9p23l.json") | |
st_lottie( | |
lottie_hello, | |
speed=1, | |
reverse=False, | |
loop=True, | |
quality="low", # medium ; high | |
renderer="svg", # canvas | |
height=None, | |
width=None, | |
key=None, | |
) |
I suggest creating a separate virtual environment and installing the required libraries there. This will ensure that you have a clean, isolated environment for running your Python code, which can help avoid conflicts with any other libraries that you have installed on your machine.
I cannot offer much Python debugging here in the comments, but I hope it gives you a starting point 😅 I hope you understand. Happy debugging!
Thank you very much. Greetings from a mexican in France.
Thank you very much. Greetings from a mexican in France.
@RoskoMx i faced the similar issue as well - just redeploy the app and you should be good. i think the issue has to do with caching in package initialization when we first deploy an app
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much for answering. I did it from the cmd of my operating system and I have also already restarted it. I'm very beginner at this, sorry.