简体   繁体   English

在Heroku上生成错误

[英]Build error on Heroku

I am pushing my Python app to Heroku, it's installing requirements and at the end it crashes. 我将Python应用程序推送到Heroku,它正在安装需求,最终崩溃。 Below is the tail of the log: 以下是日志的结尾:

....
SWIG/_m2crypto_wrap.c:4237: warning: 'saltlen' may be used uninitialized in this function
gcc -pthread -shared build/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -L/usr/lib -lssl -lcrypto -o build/lib.linux-x86_64-2.7/M2Crypto/__m2crypto.so
Creating /tmp/build_5a922389-3865-4fa2-9bc3-ecfa3cd84781/.heroku/venv/lib/python2.7/site-packages/M2Crypto.egg-link (link to .)
M2Crypto 0.22.dev is already the active version in easy-install.pth

Installed /tmp/build_5a922389-3865-4fa2-9bc3-ecfa3cd84781/.heroku/src/m2crypto
Successfully installed M2Crypto
Cleaning up...
Traceback (most recent call last):
  File "/tmp/buildpack_5a922389-3865-4fa2-9bc3-ecfa3cd84781/vendor/virtualenv-1.7/virtualenv.py", line 16, in <module>
import tempfile
  File "/usr/local/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
  File "/usr/local/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /tmp/build_5a922389-3865-4fa2-9bc3-ecfa3cd84781/.heroku/venv/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyLong_AsInt
 !     Error making virtualenv relocatable


 !     Push rejected, failed to compile Python app

This is the requrements.txt I am using: 这是我正在使用的requrements.txt:

Flask==0.10.1
SQLAlchemy==0.7.8
Flask-Login==0.2.3
Flask-WTF==0.6
Flask-Gravatar
Flask-OAuth==0.12
Flask-SQLAlchemy
Flask-Mail
python-dateutil
alembic
psycopg2
requests
itsdangerous
markdown
raven
blinker
flask-cache
flask-heroku
pygeoip
flask-babel
beautifulsoup4
python-memcached
-e git+https://github.com/Hypernode/M2Crypto#egg=M2Crypto-0.22.dev
birdy

M2Crypto is compiled before the cleanup. M2Crypto在清除之前进行编译。

Later Edit: 以后编辑:

If I run pip command on the heroku box I get a very simmilar error: 如果我在heroku框上运行pip命令,我会得到一个非常类似的错误:

Traceback (most recent call last):
  File "/app/.heroku/venv/bin/pip", line 10, in <module>
load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
  File "/app/.heroku/venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
  File "/app/.heroku/venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
  File "/app/.heroku/venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/app/.heroku/venv/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/__init__.py", line 5, in <module>
    import subprocess
  File "/usr/local/lib/python2.7/subprocess.py", line 427, in <module>
    import select
ImportError: /app/.heroku/venv/lib/python2.7/lib-dynload/select.so: undefined symbol: _PyInt_AsInt

It turns out Heroku just updated their runtime to python-2.7.7 I had to specify a runtime.txt and to purge the cache of the application(twice) to fix it. 事实证明,Heroku刚刚将其运行时更新为python-2.7.7,我必须指定runtime.txt并清除应用程序的缓存(两次)以对其进行修复。

$ cat python-2.7.7>runtime.txt

Then install heroku repo plugin and purge the cache. 然后安装heroku repo插件并清除缓存。 For Unknown reason the purge_cace did not worked for the first time and had to use twice. 由于未知的原因,purge_cace第一次不起作用,不得不使用两次。

$ heroku plugins:install https://github.com/heroku/heroku-repo.git
$ heroku repo:purge_cache -a appname

More info about heroku-repo plugin here . 有关heroku-repo插件的更多信息,请点击此处

This problem is discussed in this stackoverflow thread or this heroku forum thread . 这个stackoverflow线程这个heroku论坛线程中讨论了此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 构建成功但 Heroku 中的应用程序错误 - Build success but application error in Heroku Heroku 构建成功但“应用程序错误”{Django app} - Heroku Build succeeded but “application error” {Django app} 在Heroku上部署Flask应用会导致构建错误 - Deploying Flask app on Heroku giving build error Heroku 版本上的“=?= 未知错误”表示什么? - What does "=!= Unknown error" indicate on Heroku build? Heroku 构建失败并显示错误“PyObjC 需要 MacOS 来构建”——如何解决? - Heroku build fail with error "PyObjC requires MacOS to build" - how to fix? Heroku版本中的Gunicorn SyntaxError - Gunicorn SyntaxError in Heroku build BUILD FAIL ON HEROKU - BUILD FAIL ON HEROKU 我通过 Heroku 部署了我的 Django 服务器,构建成功,但在部署的 URL 上不断收到“应用程序错误” - I deployed my Django server via Heroku, the build was successful, but keep getting 'Application Error' on the deployed URL 成功构建 Heroku Python 应用程序但执行不成功,打开应用程序抛出错误 - Successful build of Heroku Python App but execution is unsuccessful and open app throws error 我能够在 heroku 上构建我的 django web 应用程序,但在启动时显示这些错误(错误日志如下所示) - i am able to build my django web app on heroku but while launching its showing these error(error log shown below)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM