我需要在 Heroku 上运行分发版本 0.6.28。我更新了我的requirements.txt,但这似乎没有效果。
我正在尝试从需要此较新版本的分发包的 tarball 中的模块进行安装。
在部署期间我只得到这个:
Running setup.py egg_info for package from http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.4b4/MySQL-python-1.2.4b4.tar.gz
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.27 (/tmp/build_ibj6h3in4vgp/.heroku/venv/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg))
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
最佳答案
好的,这是一个目前有效的解决方案。我认为长期修复是 Heroku 升级了他们的分发版本。
- fork python 构建包:https://github.com/heroku/heroku-buildpack-python/
- 将您需要的要求添加到包中(我将它们放在 bin/compile 中,就在其他 pip install 要求步骤之前)。请参阅https://github.com/buildingenergy/heroku-buildpack-python/commit/12635e22aa3a3651f9bedb3b326e2cb4fd1d2a4b对于那个差异。
更改您的应用的构建包:
heroku 配置:添加 BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-python.git
- 再次插入。应该可以。
关于python - 如何升级 Heroku 上的分发包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12866612/