Why buildbot throw ImportError: cannot import name exceptions

buildbotpython-2.7sqlalchemy-migrate

I am currently trying to understand buildbot and am going through the first part of tutorial. But I am stuck in the part where I am supposed to create the master. I tried fixing the error by using this website but still give me error.

Traceback (most recent call last):
File "./bin/buildbot", line 5, in <module>
pkg_resources.run_script('buildbot==0.8.7p1', 'buildbot')
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1207, in run_script
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.7p1-py2.7.egg/EGG-INFO/scripts/buildbot", line 4, in <module>
runner.run()
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.7p1-py2.7.egg/buildbot/scripts/runner.py", line 696, in run
subcommandFunction = reflect.namedObject(subconfig.subcommandFunction)
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-13.0.0-py2.7- linux-x86_64.egg/twisted/python/_reflectpy3.py", line 151, in namedObject
module = namedModule('.'.join(classSplit[:-1]))
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/python/_reflectpy3.py", line 137, in namedModule
topLevel = __import__(name)
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.7p1-py2.7.egg/buildbot/scripts/create_master.py", line 23, in <module>
from buildbot.db import connector
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.7p1-py2.7.egg/buildbot/db/connector.py", line 22, in <module>
from buildbot.db import pool, model, changes, schedulers, sourcestamps, sourcestampsets
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.7p1-py2.7.egg/buildbot/db/model.py", line 18, in <module>
import migrate.versioning.schema
File "/home/hari/tmp/buildbot/sandbox/lib/python2.7/site-packages/sqlalchemy_migrate-0.7.2-py2.7.egg/migrate/versioning/schema.py", line 10, in <module>
from sqlalchemy import exceptions as sa_exceptions
ImportError: cannot import name exceptions

Best Answer

This error occurs because of an incompatibility between SQLAlchemy 0.8+ and sqlalchemy-migrate 0.7.2. You can work around it by installing an earlier version:

$ pip uninstall sqlalchemy
$ pip install 'sqlalchemy <= 0.7.10'
Related Topic