我與NumPy和Matplotlib在Heroku上運行的運行SciPy的,我試圖安裝SciPy的爲好。但是,Scipy需要安裝BLAS [1],這在Heroku平臺上沒有提供。在聯繫Heroku支持後,他們建議我將BLAS構建爲一個靜態庫來部署,並設置必要的環境變量。在Heroku
所以,我的系統上編譯64位Linux機器libblas.a,並在[2]中設置下面的變量:
$ heroku config
BLAS => .heroku/vendor/lib/libfblas.a
LD_LIBRARY_PATH => .heroku/vendor/lib
LIBRARY_PATH => .heroku/vendor/lib
PATH => bin:/usr/local/bin:/usr/bin:/bin
PYTHONUNBUFFERED => true
在我requirements.txt加入SciPy的== 0.10.1之後,推送仍然失敗。
File "scipy/integrate/setup.py", line 10, in configuration
blas_opt = get_info('blas_opt',notfound_action=2)
File "/tmp/build_h5l5y31i49e8/lib/python2.7/site-packages/numpy/distutils/system_info.py", line 311, in get_info
return cl().get_info(notfound_action)
File "/tmp/build_h5l5y31i49e8/lib/python2.7/site-packages/numpy/distutils/system_info.py", line 462, in get_info
raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
這似乎是PIP是不知道的BLAS環境變量的,所以我檢查使用Heroku上運行的Python環境:
(venv)bash-3.2$ heroku run python
Running python attached to terminal... import up, run.1
Python 2.7.2 (default, Oct 31 2011, 16:22:04)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('bash')
~ $ echo $BLAS
.heroku/vendor/lib/libfblas.a
~ $ ls .heroku/vendor/lib/libfblas.a
.heroku/vendor/lib/libfblas.a
~ $
而且似乎罰款。現在我不知道如何解決這個問題。
[1] http://www.netlib.org/blas/ [2] http://www.scipy.org/Installing_SciPy/Linux
對不起忘了說了,如果你想使用buildpack原樣然後執行:$ Heroku的創建應用程序的名字--stack =雪松[email protected]:WYN/Heroku的-buildpack-python.git – coshx 2012-05-17 12:11:49
太棒了!我是Heroku的Python傢伙。 :) – 2012-05-18 21:45:59
謝謝,我很喜歡玩雪松堆疊和構建包。我現在正在研究vulcan製造商,我認爲用這種方法建立這些東西會很好... – coshx 2012-05-19 07:53:17