Mysql.connector ModuleNotFoundError

I have problem when running my deployed app, it shows this message:

ModuleNotFoundError: 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).


File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/", line 565, in _run_script
    exec(code, module.__dict__)File "/app/in-response/", line 6, in <module>
    import utils.util as sqlconFile "/app/in-response/utils/", line 4, in <module>
    import mysql.connectorFile "/home/appuser/venv/lib/python3.9/site-packages/mysql/connector/", line 34, in <module>
    import _version

Any Helps?

I have already create requirements file as follow:

Hi @cyberNva

It looks like you’ve fixed the ModuleNoteFoundError by changing the connector package. Next time, please read our guidelines on how to post a question on the forum, and include relevant information in your post, such as the app URL, GitHub repo, etc.

Additionally, Streamlit has a tutorial on how to connect to MySQL and it uses the official mysql-connector-python package instead: