在 Heroku 上手动删除 Python 包 [英] Manually remove Python package on Heroku

查看:18
本文介绍了在 Heroku 上手动删除 Python 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 heroku push master,得到了这个:

I was running heroku push master, and got this:

 ----- 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 包?

How can I remove the previous Django package?

更新:我的需求.txt:

UPDATE: 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

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

The text in bold fixed the above warning.

更新2:自从Django 1.5正式发布后,我就直接用了pip freeze:

UPDATE 2: Since Django 1.5 was officially released, I just used 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

推荐答案

我遇到过 Heroku 缓存损坏的包并且无法将它们取出的问题.Python buildpack 应该有某种支持刷新此缓存 (CACHE_DIR),但它没有.

I've had problems where Heroku caches broken packages and there's no way to get them out. The Python buildpack should have some kind of support for flushing this cache (CACHE_DIR), but it does not.

有一个解决方法:按照这些说明将您的 Python 运行时更改为例如 3.3.0(您的应用程序是否真的支持 Python 3 并不重要).然后将其更改回默认值.更改 Python 运行时然后部署的行为将强制 buildpack 完全清除缓存.据我所知,这是目前唯一可行的擦除缓存的方法.

There is a workaround: follow these instructions to change your Python runtime to, for instance, 3.3.0 (it doesn't matter if your app actually supports Python 3 or not). Then change it back to the default. The act of changing your Python runtime and then deploying will force the buildpack to totally erase the cache. As far as I know this is the only practical way to erase the cache at the moment.

这篇关于在 Heroku 上手动删除 Python 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆