python - 在 Heroku 中找不到满足 tensorflow==1.0.0 要求的版本

标签 python django heroku pip

我正在使用 heroku 云平台部署一个 django 项目。我在 requirements.txt 文件中添加了依赖项。但是,当我推送到 heroku master 时,出现以下错误:

Collecting tensorflow==1.0.0 (from -r /tmp/build_bc8be989466414998410d3ef4c97a115/requirements.txt (line 17))
remote:          Could not find a version that satisfies the requirement tensorflow==1.0.0 (from -r /tmp/build_bc8be989466414998410d3ef4c97a115/requirements.txt (line 17)) (from versions: )
remote:        No matching distribution found for tensorflow==1.0.0 (from -r /tmp/build_bc8be989466414998410d3ef4c97a115/requirements.txt (line 17))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy....
remote: 
remote: !   Push rejected to what-the-image.
remote: 

我使用的是 Django v 1.10 和 python 2.7。我哪里会出错?

最佳答案

您将能够使用 wheel 在 Heroku 上安装 Tensorflow .

只需将 requirements.txt 中的 tensorflow==1.0.0 行替换为 https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0 -cp27-none-linux_x86_64.whl

Wheelseggs是 Python 代码的打包格式。 Wheels 旨在取代旧的 egg 格式,并且通常更加通用,因为它们不需要可用的编译器(在部署到 PaaS 时非常有用,例如 Heroku、Microsoft 的 Azure)。

关于轮子需要注意的一件事是 naming convention ,它反射(reflect)了它们打算使用的体系结构和 Python 版本。查找系统支持的车轮类型的快速方法是:

import pip
print(pip.pep425tags.get_supported())

关于python - 在 Heroku 中找不到满足 tensorflow==1.0.0 要求的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42328863/

相关文章:

ruby-on-rails - Heroku:无法通过 Bundler 安装 gems

ruby - heroku 上的 API 轮询机器人

python - 找不到 pythonanywhere 中的 css 静态文件

python - 新 BlobServiceClient 中的旧 BlockBlobService.get_blob_to_bytes 被什么替代?

django - 自升级到 Django 4.0 以来, View 名称测试失败

jquery - 限制 ajax 自动完成结果

javascript - 单页应用程序的真实 URLS?

python - 精确率、召回率、F1 分数与 sklearn 相同

python - IO错误: File not open for reading python

git - 如何直接从我的 Gitlab 存储库部署到 Heroku