0

我尝试使用来自 IMDbPY 的 SQLobject,Python 说驱动程序不起作用——我正在运行 PostgreSQL 9.2。

C:\Users\dom\AppData\Roaming\Python\Scripts>python imdbpy2sql.py -d /imdb -u 'postgres://sid:asdf@host/imdb'
Traceback (most recent call last):
File "imdbpy2sql.py", line 501, in <module>
conn = setConnection(URI, DB_TABLES)
File "C:\Users\dom\AppData\Roaming\Python\Python27\site-packages\imdb\parser\sql\objectadapter.py", line 185, in setConnection
conn = connectionForURI(uri, **kw)
File "C:\Users\dom\AppData\Roaming\Python\Python27\site-packages\sqlobject\dbconnection.py", line 1004, in connectionForURI
connCls = self.dbConnectionForScheme(scheme)
File "C:\Users\dom\AppData\Roaming\Python\Python27\site-packages\sqlobject\dbconnection.py", line 1021, in dbConnectionForScheme
% (scheme, ', '.join(self.schemeBuilders.keys())))
AssertionError: No SQLObject driver exists for 'postgres (only sqlite, sapdb, postgresql, firebird, maxdb, rdbhost, sybase, interbase, psycopg, mysql, mssql, postgres)

我尝试再次安装它,activepython说它已经安装了:-</p>

C:\Users\dom\AppData\Roaming\Python\Scripts>pypm install sqlobject skipping "sqlobject"; already installed at "%APPDATA%\Python" (2.7)

关于使 imdbpy2sql.py/SQLobject 工作的任何想法?

4

2 回答 2

0

使用不带引号 (!) 的 DB URI。

于 2013-11-19T13:49:04.447 回答
0

迟到了,但来自 imdb2py 文档:

[其他必需的模块] 显然 SQLObject 和 SQLAlchemy 只能通过您需要安装的其他特定模块/包来访问数据库(例如:MySQL 的“mysql-python”,PostgreSQL 的“psycopg”等)。

你试过安装那些吗?

于 2015-01-05T19:43:50.657 回答