2017-06-20 73 views
1

Heroku没有看到我的Procfile并开始安装py的错误版本。为什么Heroku不能检测我的Procfile?

我想用Heroku上传一个非常基本的烧瓶应用程序。根据其他建议,我已经使用命令行创建了我的Procfile,runtime.txt和requirements.txt,而不是通过编辑器。我也确保它们位于基本的git目录中。当我进入

$ git push heroku master 

我得到如下:Procfile的

remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: !  Warning: Your application is missing a Procfile. This file tells Heroku how to run your application. 
remote: !  Learn more: https://devcenter.heroku.com/articles/procfile 
remote: -----> Installing python-2.7.13 
remote: -----> Installing pip 
remote: -----> Installing requirements with pip 
remote:  Invalid requirement: 'Python 3.6.1' 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__ 
remote:   req = Requirement(req) 
remote:   File "/app/.heroku/python/lib/python2.7/site-package/pip/_vendor/packaging/requirements.py", line 96, in __init__ 
remote:   requirement_string[e.loc:e.loc + 8])) 
remote:  InvalidRequirement: Invalid requirement, parse error at "u'3.6.1'" 
remote:   
remote: !  Push rejected, failed to compile Python app. 
remote: 
remote: !  Push failed 
remote: Verifying deploy... 
remote: 
remote: !  Push rejected to salty-springs-82445. 
remote: 
To https://git.heroku.com/salty-springs-82445.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/salty-springs 82445.git' 

内容:

web: python run.py 

下面是项目结构:

▾ Random_world/               
    ▸ __pycache__/               
    ▾ app/                 
    ▸ __pycache__/              
    ▸ static/                
    ▸ templates/               
     __init__.py               
     main.py*               
     test.txt               
    ▸ venv/                 
    config.py                
    d.py*                 
    os                 
    Procfile                
    randomizer.py               
    randomizer.pyc              
    README.md                
    requirements.txt              
    run.py*                
    runtime.txt               
    test.txt                
    word_blocks.py             
    word_blocks.pyc    

感谢。

+0

所以你不问有关Procfile,但runtime.txt?请更新您的问题以匹配。 – davidism

+0

编辑该部分,因为它看起来不相关。 @davidism –

回答

1

想通了。 Procfile在我的.gitignore中,被我愚蠢地添加。

旁注:应用程序根本不会部署,因为我是从错误的分支推送。

0

我的猜测是你忘了添加和提交你的Procfile git。