2014-10-01 138 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

相關問題