In the tutorial: http://alembic.readthedocs.org/en/latest/tutorial.html I tested the function of automatic migration generation using the following command:
alembic revision --autogenerate -m "Added account table"
and got the error:
Traceback (most recent call last): File "/usr/local/bin/alembic", line 9, in <module> load_entry_point('alembic==0.3.4', 'console_scripts', 'alembic')() File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.4-py2.7.egg/alembic/config.py", line 229, in main **dict((k, getattr(options, k)) for k in kwarg) File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.4-py2.7.egg/alembic/command.py", line 93, in revision script.run_env() File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.4-py2.7.egg/alembic/script.py", line 188, in run_env util.load_python_file(self.dir, 'env.py') File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.4-py2.7.egg/alembic/util.py", line 185, in load_python_file module = imp.load_source(module_id, path, open(path, 'rb')) File "alembic/env.py", line 20, in <module> from myapp.mymodel import Base ImportError: No module named myapp.mymodel
I am just learning alembic and also never used python. Is myapp.mymodel already there, or do I need to create it using python. How to do it? Thank you very much!
source share