如何在heroku上部署matplotlib-满足numpy需求
我正在尝试在Heroku上部署一个使用matplotlib的web应用程序。这是相关的,但似乎没有解决我的具体问题。更准确地说,我部署了一个重复的应用程序“staging”,用于测试目的。当我运行命令时:如何在heroku上部署matplotlib-满足numpy需求,heroku,matplotlib,Heroku,Matplotlib,我正在尝试在Heroku上部署一个使用matplotlib的web应用程序。这是相关的,但似乎没有解决我的具体问题。更准确地说,我部署了一个重复的应用程序“staging”,用于测试目的。当我运行命令时: git push staging master 若要将我的应用程序推送到Heroku,我会收到一个意外的Heroku推送拒绝: =======================================================================
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 git@heroku.com:warm-atoll-3630.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:warm-atoll-3630.git'
出乎意料,因为我认为我已经解决了这个问题。事实上,我的制作应用程序运行得很好。我通过一个两层需求文件解决了这个问题
requirements.txt:
numpy==1.6.2
-r ./prod-requirements.txt
matplotlib==1.1.1
other requirements...
prod-requirements.txt:
numpy==1.6.2
-r ./prod-requirements.txt
matplotlib==1.1.1
other requirements...
很明显,我已经忘记了我是如何解决这个问题的。我记得,由于matplotlib依赖于numpy的方式,以及Heroku如何通过pip安装需求,所以这很棘手。这就是我所指的。可以做些什么?提前感谢。我通过从prod-requirements.txt文件中删除matplotlib解决了这个问题(请参见原始问题)。然后部署,然后将matplotlib添加到我的prod-requirements.txt文件中,然后再次部署。我假设这就是通过使用requirements.txt实现的目标:
numpy==1.6.2
-r ./prod-requirements.txt
然后将matplotlib=1.1.1放入产品需求文件中。
但显然不是。似乎我只需要一个需求文件就可以实现这一点