在Heroku上手动删除Python包

bla*_*aze 8 deployment django installation heroku

我跑了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
Run Code Online (Sandbox Code Playgroud)

如何删除以前的Django包?

更新:我的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
Run Code Online (Sandbox Code Playgroud)

粗体文字修正了上述警告.

更新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
Run Code Online (Sandbox Code Playgroud)

And*_*ter 18

我有一些问题,Heroku缓存破坏的软件包,没有办法让它们出来.Python buildpack应该有一些支持来刷新这个缓存(CACHE_DIR),但事实并非如此.

有一种解决方法:按照这些说明将Python运行时更改为例如3.3.0(如果您的应用程序实际上支持Python 3,则无关紧要).然后将其更改回默认值.更改Python运行时然后部署的操作将强制buildpack完全擦除缓存.据我所知,这是目前擦除缓存的唯一实用方法.