Skip to content

[Bug] [ChatData] 数据库添加postgreSQL数据源报错:ValueError: Test connection Failure!No module named 'psycopg2' #2711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 of 15 tasks
flycohuang opened this issue May 21, 2025 · 1 comment
Labels
bug Something isn't working Waiting for reply

Comments

@flycohuang
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

Windows

Python version information

=3.11

DB-GPT version

main

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

win11,集显,使用deepseek代理模式

Models information

deepseek-R1

What happened

通过源码部署了DB-GPT, 使用代理模式,大模型使用的deepseek官方。在“应用管理”-“数据库”添加postgreSQL数据源报错:ValueError: Test connection Failure!No module named 'psycopg2'。

Pycharm控制台报错信息:

File "D:\WorkSpace\Projects\DB-GPT\packages\dbgpt-serve\src\dbgpt_serve\datasource\service\service.py", line 288, in test_connection return self.datasource_manager.test_connection(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\WorkSpace\Projects\DB-GPT\packages\dbgpt-serve\src\dbgpt_serve\datasource\manages\connector_manager.py", line 290, in test_connection raise ValueError(f"Test connection Failure!{str(e)}") ValueError: Test connection Failure!No module named 'psycopg2'

What you expected to happen

缺少依赖

How to reproduce

1.登录DB-GPT
2.选择应用管理→数据源→添加数据源,选择postgreSQL数据库类型
3.输入数据库连接信息后点击提交

Additional context

建议:
1.进一步完善开发文档
2.及时更新docker镜像

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@flycohuang flycohuang added bug Something isn't working Waiting for reply labels May 21, 2025
@chenliang15405
Copy link
Collaborator

it seem have not install postgreSQL depencey, please refer to this doc:http://docs.dbgpt.cn/docs/installation/integrations/postgres_install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

No branches or pull requests

2 participants