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

2024-10-01 09:32:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用heroku云平台部署一个django项目。我已经在中添加了依赖项要求.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: 

我使用的是djangov1.10和python2.7。我会错在哪里?在


Tags: thetofrombuildtxtherokuremotetensorflow
1条回答
网友
1楼 · 发布于 2024-10-01 09:32:26

您可以使用wheel在Heroku上安装Tensorflow。在

只需替换要求.txt使用https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp27-none-linux_x86_64.whl

Wheelseggs是Python代码的打包格式。Wheels的目的是取代旧的egg格式,而且通常更通用,因为它们不需要编译器(当部署到像Heroku这样的PaaS,微软的Azure时非常有用)。在

关于wheels需要注意的一点是naming convention,它反映了体系结构和它们要使用的Python版本。快速查找系统支持的车轮类型的方法是:

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

相关问题 更多 >