2017-02-19 103 views
3

我正在部署一個使用heroku雲平臺的django項目。我在requirements.txt文件中添加了依賴關係。但是,當我推到heroku高手,我得到以下錯誤:在Heroku中找不到滿足要求tensorflow == 1.0.0的版本

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。我會在哪裏出錯?

回答

3

通過使用wheel,您將能夠在Heroku上安裝Tensorflow。

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

Wheelseggs正在打包格式的Python代碼替換tensorflow==1.0.0線在你requirements.txt。車輪旨在取代舊的格式,並且通常更加通用,因爲它們不需要編譯器可用(在部署到像Heroku這樣的PaaS時非常有用,微軟的Azure)。

有一點需要注意的是naming convention,它反映了它們打算用於的架構和Python版本。快速找到您的系統支持的車輪類型是:

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

謝謝。它的工作:) – Deesha

+0

Dafuq?你能解釋一下這是怎麼回事嗎?此外,謝謝,它的工作:-) – LoremIpsum

+0

增加了答案的信息。愛上一種語言,你可以用雞蛋比較輪子:) –

相關問題