Hi, I write an app which uses the ECMWF Magics (https://anaconda.org/conda-forge/magics) to produce weather analysis maps in streamlit. When one user accesses the app, it’s OK. But several users access the app at the same time, I always get the error: “Segmentation fault (core dumped)”. I think the ECMWF Magics doesn’t support multiple threadings. So I want to lock the threading when one user makes some pictures with Magics. I use the following code:
from threading import Lock import streamlit as st lock = Lock() with lock: # call the Magics functions. image = draw_weather_analysis() st.image(image, use_column_width=True)
But this does not worked. The “Segmentation fault (core dumped)” error still display, and I found the ‘lock’ can not lock the streamlit thread. So how can I do? Thanks very much.