8

我正在跑步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 包?

更新:我的要求.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
4

3 回答 3

20

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

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

于 2013-03-01T07:25:47.440 回答
3

将当前 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
于 2013-02-25T12:24:12.893 回答
0

以为我删除了故障包和所有其他依赖它的包,但没有。每次部署时,我都会不断收到错误消息。最后,我以某种方式删除了依赖于故障包的所有其他包,一切正常。希望有人会发现这很有用

于 2021-06-09T11:26:58.663 回答