Issue while deploying: raise ImportError("Failed to import any qt binding")

Hi all,

I’m having troubles deploying my new Streamlit app via Streamlit share. Locally all works ok.

I’m getting this error:

ImportError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).

Traceback:

...
File "/app/colorextractor/functions.py", line 15, in <module>
    from viscm import viscm
File "/home/appuser/venv/lib/python3.7/site-packages/viscm/__init__.py", line 5, in <module>
    from .gui import viscm, viscm_editor
File "/home/appuser/venv/lib/python3.7/site-packages/viscm/gui.py", line 18, in <module>
    from matplotlib.backends.qt_compat import QtWidgets, QtCore, QtGui, _getSaveFileName
File "/home/appuser/venv/lib/python3.7/site-packages/matplotlib/backends/qt_compat.py", line 179, in <module>
    raise ImportError("Failed to import any qt binding")

It complains about viscm package, related to qt binding…
I’m not sure if this can be resolved?

I’ve added into requirements "PyQt5 >= 5.15.6" just for a test as originally it wasn’t there since I’m not importing it in app, but that didn’t help.

Can anyone please suggest something how to resolve this?
If not, then I’ll just remove all options in app related to viscm :confused:

My repo:

I can confirm that viscm causes the problem. For the time being, I’m disabling a function of the app that uses it, and the app deploys well…

I had never heard of this package, but looking at the source code, it looks like these might be the offending lines:

Seems odd that they are trying to force a Qt backend, maybe you can confirm with the library author what their intent is.

Best,
Randy

Thank you for the reply.

Yes, I will follow up.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.