I am trying to run alembic
migration and when I run
JavaScript
x
2
1
alembic revision --autogenerate -m "Added initial tables"
2
It fails saying
JavaScript
1
2
1
sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver
2
the database url is
JavaScript
1
2
1
postgresql+psycopg2://dev:passwd@localhost/db
2
and I even have psycopg2
installed in my virtualenv
JavaScript
1
22
22
1
$yolk -l
2
Flask-Login - 0.1.3 - active
3
Flask-SQLAlchemy - 0.16 - active
4
Flask - 0.9 - active
5
Jinja2 - 2.6 - active
6
Mako - 0.7.3 - active
7
MarkupSafe - 0.15 - active
8
Python - 2.7.2 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
9
SQLAlchemy - 0.8.0 - active
10
Werkzeug - 0.8.3 - active
11
alembic - 0.4.2 - active
12
antiorm - 1.1.1 - active
13
appscript - 1.0.1 - active
14
distribute - 0.6.27 - active
15
envoy - 0.0.2 - active
16
osascript - 0.0.4 - active
17
pep8 - 1.4.5 - active
18
pip - 1.1 - active
19
psycopg2 - 2.4.6 - active
20
wsgiref - 0.1.2 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
21
yolk - 0.4.3 - active
22
Whay could be causing this issue?
Advertisement
Answer
Here’s how to produce an error like that:
JavaScript
1
6
1
>>> from sqlalchemy import *
2
>>> create_engine("driver://")
3
Traceback (most recent call last):
4
etc
5
sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver
6
so I’d say you aren’t actually using the postgresql URL you think you are – you probably are calling upon a default-generated alembic.ini somewhere.