Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alembic ImportError: No module named config

Alembic was working great for me, running in a python virtual environment.

Then a couple hours ago I started getting this error when I run any alembic command and I have no explanation.

~/Desktop/cs/montage_web $ alembic upgrade head
Traceback (most recent call last):
  File "/Users/maxfowler/Dropbox/desktop/cs/virtualenvs/mweb/bin/alembic", line 9, in <module>
    load_entry_point('alembic==0.8.5', 'console_scripts', 'alembic')()
  File "/Users/maxfowler/Dropbox/desktop/cs/virtualenvs/mweb/lib/python2.7/site-packages/pkg_resources/__init__.py", line 474, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/maxfowler/Dropbox/desktop/cs/virtualenvs/mweb/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2582, in load_entry_point
    return ep.load()
  File "/Users/maxfowler/Dropbox/desktop/cs/virtualenvs/mweb/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2265, in load
    return self._load()
  File "/Users/maxfowler/Dropbox/desktop/cs/virtualenvs/mweb/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2268, in _load
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named config
like image 646
maxfowler Avatar asked Apr 20 '16 00:04

maxfowler


1 Answers

finally found the answer:

I had accidentally added an __init__.py file to my alembic directory in my repository which messed everything up (presumably this made my alembic code folder be discovered before the alembic python package, thus causing things to go awry).

like image 170
maxfowler Avatar answered Oct 29 '22 02:10

maxfowler