[英]How to connect Python to an open Excel workbook, using win32?
[英]Python 3.4 -> Connect to PostGres SQL using SQLAlchemy win32
我正在使用Postgres和Pandas,无法连接两者。 我已经使用SQLAlchemy创建了enginestr,如下所示
from sqlalchemy import create_engine
engine = create_engine('postgresql://postgres:password@localhost:5432/bilal')
但是,当我运行该语句时,出现以下错误
ImportError : No module names 'psycopg2'
我已经尝试安装模块,但是没有任何运气。 是因为我使用的是32位Windows计算机吗?
谢谢,
比拉尔
您安装正确吗? 使用此链接下载并安装win-psycopg或使用pip install psycopg2
您可以在连接字符串中指定它:
from sqlalchemy import create_engine
engine = create_engine('postgresql+psycopg2://postgres:password@localhost/bilal')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.