Error running 'alembic upgrade head'
dukedougal opened this issue · 2 comments
Using Python 2.7 after a fresh install I get the following error. I've dug around in the source for hours and traced it to something to do with overholt/tasks.py but I don't know how to fix it properly.
Any ideas? thanks
$ alembic upgrade head
Traceback (most recent call last):
File "/var/www/recruitinginbox.com/venv2.7/bin/alembic", line 8, in
load_entry_point('alembic==0.6.4', 'console_scripts', 'alembic')()
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/config.py", line 298, in main
CommandLine(prog=prog).main(argv=argv)
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/config.py", line 293, in main
self.run_cmd(cfg, options)
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/config.py", line 279, in run_cmd
**dict((k, getattr(options, k)) for k in kwarg)
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/command.py", line 125, in upgrade
script.run_env()
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/script.py", line 203, in run_env
util.load_python_file(self.dir, 'env.py')
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/util.py", line 212, in load_python_file
module = load_module_py(module_id, path)
File "/var/www/recruitinginbox.com/venv2.7/local/lib/python2.7/site-packages/alembic/compat.py", line 58, in load_module_py
mod = imp.load_source(module_id, path, fp)
File "alembic/env.py", line 15, in
app = create_app()
File "/var/www/recruitinginbox.com/overholt/api/init.py", line 23, in create_app
register_security_blueprint=register_security_blueprint)
File "/var/www/recruitinginbox.com/overholt/factory.py", line 44, in create_app
register_blueprints(app, package_name, package_path)
File "/var/www/recruitinginbox.com/overholt/helpers.py", line 26, in register_blueprints
m = importlib.import_module('%s.%s' % (package_name, name))
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/var/www/recruitinginbox.com/overholt/api/stores.py", line 13, in
from ..tasks import send_manager_added_email, send_manager_removed_email
File "/var/www/recruitinginbox.com/overholt/tasks.py", line 12, in
celery = create_celery_app()
File "/var/www/recruitinginbox.com/overholt/factory.py", line 52, in create_celery_app
app = app or create_app('overholt', os.path.dirname(file))
File "/var/www/recruitinginbox.com/overholt/factory.py", line 44, in create_app
register_blueprints(app, package_name, package_path)
File "/var/www/recruitinginbox.com/overholt/helpers.py", line 26, in register_blueprints
m = importlib.import_module('%s.%s' % (package_name, name))
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named overholt
I had the same problem because I cloned overholt into a directory named "overholt.git". Removing .git fixed it for me - seems to be some alembic error.
This was caused in the end by import problems. Not sure but I think it is because of the "import *" statements. Converting to absolute imports fixed it.