PostgresSql 环境变量 $DATABASE_URL 未设置,并且未给出连接字符串

问题描述 投票:0回答:1

当我尝试从 jupyter 笔记本中的 postgressql 读取数据时,我看到连接错误。错误提示:

Connection info needed in SQLAlchemy format, example:
               postgresql://username:password@hostname/dbname
               or an existing connection: dict_keys([])

据我所知,示例格式与我提供的连接字符串匹配。 我还检查了 sqlachemy 的版本是否已更新。 我错过了什么?

engine=create_engine(f'postgresql://postgres:root@localhost/GoldPrices')
engine.connect()
#To load ipython-sql
%load_ext sql
%sql postgresql://postgres:root@localhost/GoldPrices 

postgresql sqlalchemy pgadmin
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.