python - 部署 Heroku Web 应用程序时加载 pandas 时出现问题
问题描述
不幸的是,我在部署 Heroku Web 应用程序时遇到了问题。它只是一个基于 dash by plotly 的简单 Python 仪表板,但我是初学者,不知何故它无法上传 Pandas。请在下面找到 Heroku 的问题报告。是否需要更多信息来评估问题?
感谢并很高兴听到您的建议:-)
-----> 在 Heroku-20 堆栈上构建
-----> 检测到 Python 应用程序
-----> 安装 python-3.6.12
-----> 安装 pip 20.1.1、setuptools 47.1.1 和 wheel 0.34.2
-----> 安装 SQLite3
-----> 使用 pip 安装需求
Collecting Brotli==1.0.9
Downloading Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl (357 kB)
Collecting click==7.1.2
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting dash==1.18.1
Downloading dash-1.18.1.tar.gz (74 kB)
Collecting dash-core-components==1.14.1
Downloading dash_core_components-1.14.1.tar.gz (3.5 MB)
Collecting dash-html-components==1.1.1
Downloading dash_html_components-1.1.1.tar.gz (188 kB)
Collecting dash-renderer==1.8.3
Downloading dash_renderer-1.8.3.tar.gz (1.0 MB)
Collecting dash-table==4.11.1
Downloading dash_table-4.11.1.tar.gz (1.8 MB)
Collecting Flask==1.1.2
Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting Flask-Compress==1.8.0
Downloading Flask_Compress-1.8.0-py3-none-any.whl (7.2 kB)
Collecting future==0.18.2
Downloading future-0.18.2.tar.gz (829 kB)
Collecting gunicorn==20.0.4
Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Collecting itsdangerous==1.1.0
Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Jinja2==2.11.2
Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting MarkupSafe==1.1.1
Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (27 kB)
Collecting numpy==1.19.5
Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
ERROR: Could not find a version that satisfies the requirement pandas==1.2.0 (from -r /tmp/build_07fd5168/requirements.txt (line 16)) (from versions: 0.1, 0.2b0, 0.2b1, 0.2, 0.3.0b0, 0.3.0b2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0rc1, 0.8.0rc2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0rc1, 0.19.0, 0.19.1, 0.19.2, 0.20.0rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0rc1, 0.21.0, 0.21.1, 0.22.0, 0.23.0rc2, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0rc1, 0.24.0, 0.24.1, 0.24.2, 0.25.0rc0, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0rc0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0rc0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5)
ERROR: No matching distribution found for pandas==1.2.0 (from -r /tmp/build_07fd5168/requirements.txt (line 16))
!推送被拒绝,无法编译 Python 应用程序。
!推送失败
解决方案
如前所述,将 Pandas 版本降级为 Heroku 中所选运行时可用的最高版本是可行的(在您的情况下,是pandas==1.1.5
)。
您还可以考虑将 Python 运行时版本从 升级3.6
到3.8
或3.9
,如果pandas==1.3.0
可用。这在此处进行了描述。
推荐阅读
- php - str_replace 特殊字符场景
- powershell - 从 AD 检索 Bitlocker 恢复密钥
- scala - from_json 不是对象 org.apache.spark.sql.functions 的成员
- python - Peewee AttributeError-选择多个以上的加入时
- ios - 如何在 iOS 应用中将录制的语音设置为通知声音?
- android - AsyncTask 在 Android 8.1.0 上暂停
- python - 使用 TensorFlow 训练 NN 时出错:TypeError: 'Series' 对象是可变的,因此它们不能被散列
- java - Spring Reactive Application 客户端中的不同错误
- c# - 第一个选项卡图标未调整大小 iOS TabbedRenderer
- sql - 用于插入项目的迁移脚本 sql server