我想在Heroku上部署一個使用matplotlib的web應用程序。這question是相關的,但似乎沒有解決我的具體問題。更確切地說,我正在部署一個重複的應用程序「staging」用於測試目的。當我運行命令:如何在heroku上部署matplotlib - 滿足numpy需求
git push staging master
推我的應用程序的Heroku我得到意想不到的Heroku推排斥:
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.1.1
python: 2.7.2 (default, Oct 31 2011, 16:22:04) [GCC 4.4.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: no
* You must install numpy 1.4 or later to build
* matplotlib.
Complete output from command python setup.py egg_info:
basedirlist is: ['/usr/local', '/usr']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.1.1
python: 2.7.2 (default, Oct 31 2011, 16:22:04) [GCC 4.4.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: no
* You must install numpy 1.4 or later to build
* matplotlib.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/build_sj82km4g47z3/.heroku/venv/build/matplotlib
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python app
To [email protected]:warm-atoll-3630.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:warm-atoll-3630.git'
意外,因爲我以爲我已經解決了這個問題。事實上,我的生產應用程序工作得很好。我解決了它有一個兩層的需求文件。
requirements.txt:
numpy==1.6.2
-r ./prod-requirements.txt
PROD-requirements.txt:
matplotlib==1.1.1
other requirements...
顯然,我已經忘記了如何我其實解決這個問題。我記得那是因爲matplotlib依賴numpy的方式以及Heroku如何通過pip安裝需求,這很棘手。這裏是我指的issue。可以做什麼?提前致謝。