When deploying on Streamlit Cloud it failed with the following ImportError. This occurs when import common python packages such as matplotlib, seaborn, scipy, etc. In my local Windows (with Anaconda installations) it runs without issues. Does anyone know how to fix this? Thanks!
File "/home/appuser/.conda/lib/python3.7/site-packages/matplotlib/transforms.py", line 46, in <module>
from matplotlib._path import (
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/appuser/.conda/lib/python3.7/site-packages/matplotlib/_path.cpython-37m-x86_64-linux-gnu.so)
Did not resolve the issue for me. I wonder if it’s something on your end. I suppose I can switch to pip in requirements.txt, but I’d rather stick with conda. Thanks.
@blackary I do not mean to take attention away from @LuanNguyen , but I am chiming in because I am experiencing the same problem. I tried redeploying with 3.9 even before I changed packages.txt, but to no avail. My code is at https://github.com/akurlovs/DiSiR_app . Thanks!
@blackary
I have a similar issue. Running the app on my system works fine. But once I deploy it on the cloud, importing seaborn causes the error. Matplotlib works, inlcuding
in my environment.yml does not solve the problem.
Maybe there is an update since this was first posted?
Thanks for helping! I see your solution is using pip install instead of conda. Only problem is that what I’ve shared here is a quick example, but in my actual project I’m using cartopy, which is a bit of a mess to install using pip… I’ll give it a try but if anyone finds a solution using conda I’ll be happy to hear it!
The page I made (https://isoldeglissenaar-procast-home-m0hdpf.streamlit.app/) looks fine on the homepage because I’m not applying scipy or matplotlib yet. If you click on ‘archive’ in the sidebar though it crashes when trying to use matplotlib.
However, it still does not work on streamlit cloud. IMHO the problem is not matplotlib or cartopy, it seems to be the format of the data files in the data folder, read by the xarray library. They are probably in a strange or new HDF5 format variant.