I was successfully using your tutorial application flask_app.py then I decided to get bold and installed your virturalenv. All worked well after except for the SQLAlchemy/MySQL logic which then reported 'No module named mysql' upon accessing the contacts db. Can someone explain how fix this?
From python command line I entered:
from flask_app import Comment
comments=Comment.query.all()
The results ended with
Traceback (most recent call last): File
"/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/sqlalchemy/util/_collections.py",
line 988, in __call__
return self.registry[key] KeyError: 140307501483840 During handling of the above exception, another exception occurred: Traceback
(most recent call last): File "<stdin>", line 1, in <module> File
"/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/flask_sqlalchemy/__init__.py", line 500, in __get__
return type.query_class(mapper, session=self.sa.session()) File "/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/sqlalchemy/orm/scoping.py",
line 78, in __call__
return self.registry() File "/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/sqlalchemy/util/_collections.py",
line ......
return strategy.create(*args, **kwargs) File "/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/sqlalchemy/engine/strategies.py",
line 75, in create
dbapi = dialect_cls.dbapi(**dbapi_args) File "/home/bobgott/.virtualenvs/my-virtualenv/lib/python3.4/site-packages/sqlalchemy/dialects/mysql/mysqlconnector.py",
line 107, in dbapi
from mysql import connector ImportError: No module named 'mysql'
[edit by admin: formatting]