Forums

Import Error: MySQL

Hi,

I am trying to set up a simple flask app to use SMS communication with twilio.

I encountered some problems earlier with needing to use a proxy in order to connect to Twilio, so I changed from python 3.6 to 3.4 and started using a virtualenv so I could install the latest versions of everything.

However, now whenever I try to access the app I get an error and the error logs show that the WSGI file failed to open the MySQL module. The full stack trace can be found in my error logs, and shows that SQLAlchemy tries to access this module:

2017-08-02 07:43:11,497: Error running WSGI application
2017-08-02 07:43:11,517: ImportError: No module named 'mysql'

If I try to install mysql in my virtual env, I get another error.

    ImportError: No module named 'ConfigParser'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2m4dhw71/MySQL-python/

But I have installed ConfigParser.

I'm not sure where to go from here and I can't even get the simplest pages running, so any help would be greatly appreciated.

If you are using a virtualenv, please provide that in your webapp config (ie. go to the PythonAnywhere webapp tab, and go to the virtualenv section, and add your virtualenv path, then reload your webapp)