Issue with pymupdf on SCC

Hello everyone, I’ve got an issue with a cloud deployment which uses PyMuPDF and Fitz to convert PDFs to an image. I am currently using Streamlit 1.28 and Python 3.9. My requirements file contains:

(custom packages)
streamlit
pytesseract
pymupdf

My packages.txt contains:
libgl1
tesseract-ocr

When I run the application locally, I have no issues, but the same deployment on cloud breaks for the below error:

    import fitz
File "/home/adminuser/venv/lib/python3.9/site-packages/fitz/__init__.py", line 1, in <module>
    from frontend import *
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/__init__.py", line 1, in <module>
    from .events import *
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/events/__init__.py", line 1, in <module>
    from .clipboard import *
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/events/clipboard.py", line 2, in <module>
    from ..dom import Event
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/dom.py", line 439, in <module>
    from . import dispatcher
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/dispatcher.py", line 15, in <module>
    from . import config, server
File "/home/adminuser/venv/lib/python3.9/site-packages/frontend/server.py", line 24, in <module>
    app.mount(config.STATIC_ROUTE, StaticFiles(directory=config.STATIC_DIRECTORY), name=config.STATIC_NAME)
File "/home/adminuser/venv/lib/python3.9/site-packages/starlette/staticfiles.py", line 57, in __init__
    raise RuntimeError(f"Directory '{directory}' does not exist")

Is this an issue with any particular version(s) that I might need to address to be compatible with community cloud? The app is currently private while in development.

I set up a repository according to your description and deployed id in Streamlit Cloud. import fitz was executed without issues.

Try rebooting or redeploying your app. If that doesn’t work, there must be something relevant that you didn’t tell us.