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

Traceback:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/app/in-response/main.py", line 6, in <module>
    import utils.util as sqlconFile "/app/in-response/utils/util.py", line 4, in <module>
    import mysql.connectorFile "/home/appuser/venv/lib/python3.9/site-packages/mysql/connector/__init__.py", 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:

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