Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

python - sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver

I am trying to run alembic migration and when I run

alembic revision --autogenerate -m "Added initial tables"

It fails saying

sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver

the database url is

postgresql+psycopg2://dev:passwd@localhost/db

and I even have psycopg2 installed in my virtualenv

$yolk -l
Flask-Login     - 0.1.3        - active
Flask-SQLAlchemy - 0.16         - active
Flask           - 0.9          - active
Jinja2          - 2.6          - active
Mako            - 0.7.3        - active
MarkupSafe      - 0.15         - active
Python          - 2.7.2        - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
SQLAlchemy      - 0.8.0        - active
Werkzeug        - 0.8.3        - active
alembic         - 0.4.2        - active
antiorm         - 1.1.1        - active
appscript       - 1.0.1        - active
distribute      - 0.6.27       - active
envoy           - 0.0.2        - active
osascript       - 0.0.4        - active
pep8            - 1.4.5        - active
pip             - 1.1          - active
psycopg2        - 2.4.6        - active
wsgiref         - 0.1.2        - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
yolk            - 0.4.3        - active

Whay could be causing this issue?

question from:https://stackoverflow.com/questions/15648814/sqlalchemy-exc-argumenterror-cant-load-plugin-sqlalchemy-dialectsdriver

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's how to produce an error like that:

>>> from sqlalchemy import *
>>> create_engine("driver://")
Traceback (most recent call last):
... etc
sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialects:driver

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...