将Django项目推送到Heroku时出错 [英] Error pushing Django project to Heroku
问题描述
我一直在尝试解决这个错误大约一个小时,我已经用尽了解决方案,请帮助我。
heroku创建
运行良好无问题
git push heroku master
计数对象:119,完成。
使用多达4个线程的Delta压缩。
压缩对象:100%(118/118),完成。
写入对象:100%(119/119),1.39 MiB | 66 KiB / s,完成。
总计119(delta 4),重用0(delta 0)
-----> Python应用程序检测到
----->没有提供runtime.txt;假设python-2.7.3。
----->准备Python运行时(python-2.7.3)
----->安装Distribute(0.6.34)
----->安装Pip(1.2.1)
----->使用Pip(1.2.1)
下载/解压缩Django == 1.4.3(从-r requirements.txt(第1行))
运行setup.py egg_info包Django
下载/解包dj-database-url == 0.2.1(从-r requirements.txt(第2行))
下载dj-database-url-0.2.1.tar.gz
运行setup.py egg_info for package dj-database-url
下载/打包psycopg2 == 2.4.6(从-r requirements.txt(第3行))
运行setup.py egg_info for package psycopg2
没有以前包含的目录找到匹配'doc / src / _build'
下载/解压缩virtualenv == 1.8.4.post1(从-r requirements.txt(行4))
找不到满足要求的版本virtualenv == 1.8.4.post1(从-r requirements.txt(第4行))(从版本:)
没有匹配版本的发行版for virtualenv == 1.8.4.post1(from -r requirements.t xt(第4行))
存储完整的登录/app/.pip/pip.log
! Heroku推送拒绝,无法编译Python应用程序
To git@heroku.com:[blocked] .git
! [远程拒绝]主 - > master(预收款钩子拒绝)
错误:未能推送一些参考文献'git@heroku.com:[blocked] .git'
需求文件:
> Django == 1.4.3
> dj-database-url == 0.2.1
> psycopg2 == 2.4.6
> virtualenv == 1.8.4.post1
procfile
web:python manage.py runserver 0.0。 0.0:$ PORT --noreload
Heroku日志:
'heroku'宝石已被弃用,并用Heroku Toolbelt替换,请从https://toolbelt.heroku.com下载并安装。
2013-01-24T01:22:06 + 00:00 heroku [api]:启用Logplex [私人电子邮件] @ yahoo.com
2013-01-24T01:22:06 +00:00 heroku [api]:由[私人电子邮件] @ yahoo.com创建的版本v2 @ b $ b 2013-01-24T01:22:42 + 00:00 heroku [slugc]:Slug compilation开始
2013-01-24T01:23:38 + 00:00 heroku [slugc]:插件编译失败:无法编译Python应用程序
2013-01-24T01:43:26 + 00:00 heroku [slugc]:Slug编译开始
2013-01-24T01:43:51 + 00:00 heroku [slugc]:插件编译失败:无法编译Python应用程序
2013-01-24T02:27:36 + 00:00英雄[slugc]:Slug汇编开始
2013-01-24T02:28:08 + 00:00 heroku [slugc]:Slug编译失败:无法编译Python应用程序
2013-01-24T02:32 :08 + 00:00 heroku [slugc]:Slug compilation started
2013-01-24T02:32:32 + 00:00 heroku [slugc]:Slug compilation failed:无法编译Python app
2013 -01-24T02:43:32 + 00:00 heroku [slugc]:Slug compilation开始
2013-01-24T02:43:59 + 00:00 heroku [slugc]:Slug compilat离线失败:无法编译Python应用程序
2013-01-24T02:46:23 + 00:00 heroku [slugc]:Slug编译开始
2013-01-24T02:46:52 + 00:00英文[slugc]:S lug lug failed failed:::::app app app app app app app app app app 50 50 b 50 b b b b b b b b started started started started started started started started started started started started started started started
2013-01-24T02:50 :26 + 00:00 heroku [slugc]:插件编译失败:无法编译Python应用程序
- 克隆您的git repo
- 从
requirements.txt
$ b中删除 -
git add。
-
git commit -m删除virtualenv要求
-
git push heroku master
virtualenv == 1.8.4
$ b 我假设你从你的...中删除了virtualenv,而不是 git add。
和 git commit
要求。对于 git
repo所做的任何更改都不会生效,对于 github
和 heroku
,直到添加
然后 commit
本地更改,最后 push
他们到远程存储库,即 Github 或 Heroku 。
I've been trying to fix this error for about an hour now and I've ran out of solutions so please help me.
heroku create
runs fine no problems
git push heroku master
Counting objects: 119, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (118/118), done.
Writing objects: 100% (119/119), 1.39 MiB | 66 KiB/s, done.
Total 119 (delta 4), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.3.
-----> Preparing Python runtime (python-2.7.3)
-----> Installing Distribute (0.6.34)
-----> Installing Pip (1.2.1)
-----> Installing dependencies using Pip (1.2.1)
Downloading/unpacking Django==1.4.3 (from -r requirements.txt (line 1))
Running setup.py egg_info for package Django
Downloading/unpacking dj-database-url==0.2.1 (from -r requirements.txt (line 2))
Downloading dj-database-url-0.2.1.tar.gz
Running setup.py egg_info for package dj-database-url
Downloading/unpacking psycopg2==2.4.6 (from -r requirements.txt (line 3))
Running setup.py egg_info for package psycopg2
no previously-included directories found matching 'doc/src/_build'
Downloading/unpacking virtualenv==1.8.4.post1 (from -r requirements.txt (line 4))
Could not find a version that satisfies the requirement virtualenv==1.8.4.post1 (from -r requirements.txt (line 4)) (from versions: )
No distributions matching the version for virtualenv==1.8.4.post1 (from -r requirements.txt (line 4))
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python app
To git@heroku.com:[blocked].git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:[blocked].git'
requirements file:
>Django==1.4.3
>dj-database-url==0.2.1
>psycopg2==2.4.6
>virtualenv==1.8.4.post1
procfile
web: python manage.py runserver 0.0.0.0:$PORT --noreload
Heroku Logs:
The 'heroku' gem has been deprecated and replaced with the Heroku Toolbelt, download and install from https://toolbelt.heroku.com.
2013-01-24T01:22:06+00:00 heroku[api]: Enable Logplex by [private email]@yahoo.com
2013-01-24T01:22:06+00:00 heroku[api]: Release v2 created by [private email]@yahoo.com
2013-01-24T01:22:42+00:00 heroku[slugc]: Slug compilation started
2013-01-24T01:23:38+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T01:43:26+00:00 heroku[slugc]: Slug compilation started
2013-01-24T01:43:51+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T02:27:36+00:00 heroku[slugc]: Slug compilation started
2013-01-24T02:28:08+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T02:32:08+00:00 heroku[slugc]: Slug compilation started
2013-01-24T02:32:32+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T02:43:32+00:00 heroku[slugc]: Slug compilation started
2013-01-24T02:43:59+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T02:46:23+00:00 heroku[slugc]: Slug compilation started
2013-01-24T02:46:52+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
2013-01-24T02:49:48+00:00 heroku[slugc]: Slug compilation started
2013-01-24T02:50:26+00:00 heroku[slugc]: Slug compilation failed: failed to compile Python app
I was able to get this running by:
- cloning your git repo
- removing the
virtualenv==1.8.4
from yourrequirements.txt
git add .
git commit -m "removing virtualenv requirement"
git push heroku master
I'm assuming you did not git add .
and git commit
after removing the virtualenv from your requirements. Any changes you make to a git
repo will not go in effect, for both github
and heroku
, until you add
and then commit
the changes locally, and finally push
them to remote repository i.e. Github or Heroku.
这篇关于将Django项目推送到Heroku时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!