为了安装OpenGnSys,我们需要运行脚本然后调用python脚本。这个python脚本给出以下错误:
[root@custrohitkr opengnsys2-web]# ./db.py
postgresql://opengnsys:opengnsys@localhost/opengnsys
Traceback (most recent call last):
File "./db.py", line 88, in <module>
create()
File "./db.py", line 81, in create
db = create_engine(database, echo=False)
File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/__init__.py", line 223, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/strategies.py", line 48, in create
dialect_cls = u.get_dialect()
File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/url.py", line 91, in get_dialect
module = getattr(__import__('sqlalchemy.databases.%s' % self.drivername).databases, self.drivername)
ImportError: No module named postgresql
在网上搜索后,我发现应为psycopg2
安装模块postgesql
。但就我而言,它已经存在了。可能是什么问题?
答案 0 :(得分:0)
Are we talking about a misconfiguration of the url
postgresql://opengnsys:opengnsys@localhost/opengnsys
vs
postgresql+psycopg2://scott:tiger@localhost/mydatabase
答案 1 :(得分:0)
尝试指定端口号,即3306