ImportError with scipy (GLIBCXX_3.4.29 not found)

I am trying in vain to deploy my Streamlit app (it runs locally with no problems). However, I cannot get scipy.optimize to work.

ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/appuser/venv/lib/python3.9/site-packages/scipy/optimize/_highs/_highs_wrapper.cpython-39-x86_64-linux-gnu.so)

Shouldn’t this `GLIBCXX_3.4.29’ file be installed with the dependencies of scipy?

This is the Github Repo.
This is what my environment.yml file looks like:

name: stuetz
channels:
  - defaults
dependencies:
  - streamlit=1.11.0
  - pandas=1.5.1
  - plotly=5.9.0
  - numpy=1.23.4
  - scipy=1.9.3
  - gxx_linux-64

Please help me out!

I see you tried out a requirements.txt file in place of the environment.yml file you mentioned here since your post. Did you have any luck with that? If not, did you try rebooting your app after a change in how you’ve defined your requirements?

Also, I found a thread on StackOverflow that may be related. Can you scroll through your terminal logs in Streamlit Cloud to see if there is any mention of how it got installed, especially the idea mentioned re: the variations like usr/lib/ vs usr/local/lib/.

Thanks for answering.
I could solve the problem by replacing the environment.yml by a requirements.txt file.
It looks like this:

streamlit==1.11.0
pandas==1.5.1
plotly==5.9.0
numpy==1.23.4
scipy==1.9.3

Hoewever, packages will be istalled by pip in that case while i use conda in my local environment.

I think there is no way in the terminal logs to see if and which version of a package has been successfully installed which makes debugging very cumbersome.

It would be a great addition if Streamlit could print a list of installed packages (including the version number) after deploying the app in the terminal.

If you need to check your resultant environment, you can always write lines at the top of your main app such as st.write(streamlit.__version__) to get versions of imported packages.

Also, if you look at the terminal, you can see what it installed since it says explicitly “downloading --…”

That’s great advice, thanks.
I wasn’t sure if the Downloading lines in terminal would indicate the package was successfully installed also.

Printing the package versions at the top of the app seems like a solid idea!