Forums

works in console but not as the application ModuleNotFoundError: No module named 'mysql'

Error running WSGI application 2021-12-17 15:29:32,038: ModuleNotFoundError: No module named 'mysql' 2021-12-17 15:29:32,038: ", line 17, in <module> 2021-12-17 15:29:32,038: from app import app as application # noqa 2021-12-17 15:29:32,038: 2021-12-17 15:29:32,039: File "/home/umitbhargava/mysite/app.py", line 7, in <module> 2021-12-17 15:29:32,039: from mysql.connector import MySQLConnection, Error

I have installed all the dependencies and I could check from python console that from mysql.connector import MySQLConnection, Error

does not give any error. Could you let me know how can I fix this. I am not using any virtual environement.

Opps I figured out the it was in the virtual environment. I installed the libs and it is working fine now.

Glad you've figured that out!