2014-10-01 141 views
2

Im heroku上的新功能,我试图在那里部署我的应用程序。但它失败,我收到以下消息:我不能在Heroku上部署我的烧瓶应用程序

Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__ 
    file__='/tmp/pip_build_u21590/matplotlib/setup.py';exec(compile(getattr(tokenize 
, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" inst 
all --record /tmp/pip-4IJQX6-record/install-record.txt --single-version-external 
ly-managed --compile failed with error code 1 in /tmp/pip_build_u21590/matplotli 
b 
Traceback (most recent call last): 
File "/app/.heroku/python/bin/pip", line 9, in <module> 
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() 
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/ 
__init__.py", line 185, in main 
return command.main(cmd_args) 
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/ 
basecommand.py", line 161, in main 
text = '\n'.join(complete_log) 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 70: ordinal 
not in range(128) 

!  Push rejected, failed to compile Python app 

To [email protected]:salty-oasis-2440.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:salty-oasis-2440.git' 

和上面是我的质量要求的列表:

  • 瓶== 0.10.1
  • configobj == 5.0.0
  • gunicorn == 19.1.1
  • itsdangerous == 0.24
  • Jinja2的== 2.7.2
  • matplot LIB == 1.3.1
  • networkx == 1.8.1
  • numpy的== 1.8.1
  • pyparsing == 1.5.7
  • 蟒-dateutil == 2.2
  • WERKZEUG == 0.9。 4

我在做什么错?

在此先感谢!

+0

complete_log可能有一个unicode字符。最后检查.encode()方法检查它是否有效。 – 2014-10-01 16:05:43

+0

尝试查看(文件)'requirements.txt'的编码 – 2014-10-01 17:04:30

回答

-1

里面你的项目的工作VIRTUALENV键入以下命令:

pip freeze > requirements.txt 

注意:如果你没有为您的项目的virtualenv考虑创建一个项目,然后安装所有需要有并运行以上再次命令。

之后添加新的requirements.txt到您的项目库,并把它推到Heroku的:

git commit requrements.txt -m "new one from pip" 
git push heroku 
+0

这是对如何生成Heroku应用程序的需求的一个很好的描述,但不是问题的答案。实际的问题是用'点子'(见我的答案)。 – gwg 2014-11-26 22:03:30

+0

看来你是对的。我认为OP已经手动编辑了需求文件。 – 2014-12-01 11:50:28

相关问题