为什么部署时 Streamlit 共享 pyodbc 错误?

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

我有一个简单的 streamlit 应用程序,它使用 pyodbc 连接到 SQL 服务器。 它在本地运行良好,但当我尝试在 streamlit Cloud 上部署时,出现此错误:

    import pyodbc
    ModuleNotFoundError: No module named 'pyodbc' 

在我的 Git 中我有 requirement.txt 包含:

  • 网络x==3.0
  • streamlit==1.11.1
  • pyodbc==4.0.30
  • 熊猫==1.0.5
  • numpy==1.22.0
  • matplotlib==3.2.2

我还有 packages.txt 包含:

  • unixodbc-dev

有人知道部署过程中出了什么问题吗?

谢谢!

python deployment cloud pyodbc streamlit
1个回答
0
投票

需求文件应该命名为“requirements.txt”而不是“requirement.txt”

© www.soinside.com 2019 - 2024. All rights reserved.