【问题标题】:Python app deployed to Heroku : No matching distribution found部署到 Heroku 的 Python 应用程序:未找到匹配的分布
【发布时间】:2021-02-11 05:56:37
【问题描述】:

我使用 dash 框架构建了一个应用程序,并正在尝试将该应用程序部署到 heroku。我的requirements.txt 看起来像这样:

   pandas
   dash
   Flask
   sklearn
   ... 
   ...
   ...
   sympy
   statsmodel

安装sympy 和/或statsmodel 时出现错误

Collecting sympy
remote:          Downloading sympy-1.7.1-py3-none-any.whl (5.9 MB)
remote:        ERROR: Could not find a version that satisfies the requirement statsmodel (from -r /tmp/build_800c2283/requirements.txt (line 18)) (from versions: none)
remote:        ERROR: No matching distribution found for statsmodel (from -r /tmp/build_800c2283/requirements.txt (line 18))
remote:  !     Push rejected, failed to compile Python app.
remote: 

根据文档,具有不受支持的依赖项且不提供许多轮子的软件包将不会安装。有解决办法吗?

https://devcenter.heroku.com/articles/python-pip

【问题讨论】:

  • 尝试从 requirements.txt 中删除 statsmodel
  • 不要手动创建requirements.txt。使用命令python -m pip freeze > requirements.txt。这将使用您使用的库版本自动与您一起编写文件。

标签: python heroku plotly-dash


【解决方案1】:

问题是包名statsmodel

ERROR: Could not find a version that satisfies the requirement statsmodel

包名为statsmodels。你忘了以s 结尾。查看安装documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-09
    • 2014-07-16
    • 1970-01-01
    • 2021-06-11
    • 2020-04-09
    • 2019-05-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多