Django 在Heroku上手动删除Python包

Django 在Heroku上手动删除Python包,django,deployment,heroku,installation,Django,Deployment,Heroku,Installation,我正在运行heroku push master,得到了以下结果: ----- Python app detected ----- No runtime.txt provided; assuming python-2.7.3. ----- Using Python runtime (python-2.7.3) ----- Installing dependencies using Pip (1.2.1) Downloading/unpacking Django-1.5c2

我正在运行heroku push master,得到了以下结果:

 ----- Python app detected
 ----- No runtime.txt provided; assuming python-2.7.3.
 ----- Using Python runtime (python-2.7.3)
 ----- Installing dependencies using Pip (1.2.1)
        Downloading/unpacking Django-1.5c2 from https://www.djangoproject.com/download/1.5c2/tarball (from -r
                                                                                                             requirements.txt (line 1))
          Cannot determine compression type for file /tmp/pip-rYIGHS-unpack/tarball.ksh
          Running setup.py egg_info for package Django-1.5c2

        Installing collected packages: Django-1.5c2
          Running setup.py install for Django-1.5c2
            changing mode of build/scripts-2.7/django-admin.py from 600 to 755

            changing mode of /app/.heroku/python/bin/django-admin.py to 755


            ========
            WARNING!
            ========

            You have just installed Django over top of an existing
            installation, without removing it first. Because of this,
            your install may now include extraneous files from a
            previous version that have since been removed from
            Django. This is known to cause a variety of problems. You
            should manually remove the

            /app/.heroku/python/lib/python2.7/site-packages/django

            directory and re-install Django.

        Successfully installed Django-1.5c2
如何删除以前的Django包

更新: My requirements.txt:

https://www.djangoproject.com/download/1.5c2/tarball/**#egg=django**
South==0.7.6
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.2.1
psycopg2==2.4.6
wsgiref==0.1.2
PIL==1.1.7
粗体文本修复了上述警告

更新2: 自从Django 1.5正式发布以来,我只使用了pip freeze:

Django==1.5
South==0.7.6
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.2.1
psycopg2==2.4.6
wsgiref==0.1.2
PIL==1.1.7

将当前virtenv包推送到文件

pip freeze > requirements.txt
承诺

git commit -am 'update packages'
然后推到heroku

git push heroku
然后heroku将重建环境

Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (13/13), 1.26 KiB, done.
Total 13 (delta 3), 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 Flask==0.9 (from -r requirements.txt (line 1))
Running setup.py egg_info for package Flask

我在Heroku缓存坏包的地方遇到了问题,无法将它们取出。Python构建包应该支持刷新这个缓存(cache_DIR),但它不支持


有一个解决方法:按照下面的步骤将Python运行时更改为3.3.0(不管您的应用程序是否支持Python 3)。然后将其更改回默认值。更改Python运行时然后部署的行为将强制buildpack完全擦除缓存。据我所知,这是目前唯一实用的清除缓存的方法。

认为我删除了有故障的包和所有依赖它的包,但没有。每次部署时,我都会收到一个错误。最后,我以某种方式剥离了所有依赖于错误包的其他包,所有包都工作得很好。希望有人会觉得这很有用

Django是如何在您的
requirements.txt
中指定的?您是否告诉它使用特定的版本?请参阅上面的更新。@metroxylon检查当您推动更改时,dyno会发生什么情况
heroku logs-t
。尝试从需求中删除
Django==1.5
,提交,推送到heroku,然后使用Django添加并提交。当您从pypi安装切换到github时,heroku无法识别更改。它不会在pypi版本上安装github版本。这是我做的(除了外部egg)。将更新我的需求。TXT这为我解决了问题。我尝试手动运行heroku run pip卸载我的_软件包,该软件包“工作正常”(没有失败),但该软件包仍在系统中,给我带来了问题。谢谢你的提示!是的,到今天还在工作。更改(或首次添加)runtime.txt,然后重新部署会导致Heroku创建一个新的运行时环境,有效地破坏任何遗留问题,例如拒绝使用github url中相同包的不同版本覆盖PYPI中以前安装的包。这对我不起作用。。。我的意思是,当我将运行时更改为不同版本的python时确实如此,但当我将其更改回我真正想要使用的版本时,它使用了旧的缓存。@Micah在我读到你的评论之前,我正准备愤怒地跺跺我的笔记本电脑,tks