将 Django 应用程序部署到 Heroku 时遇到问题:名称“install”没有定义

发布于 2024-12-06 19:46:02 字数 1388 浏览 3 评论 0原文

编辑:我将问题范围缩小到requirements.txt 文件中存在“distribute==0.6.10”行。删除该行可以解决问题,并且还没有遇到因该行不存在而导致的任何错误...。

我在这里关注教程: http://devcenter.heroku.com/articles/django

一切都很顺利,直到我到达标题为“运行工人”的部分。我的requirements.txt 文件中有以下内容:

Django==1.3
amqplib==1.0.1
anyjson==0.3.1
celery==2.3.3
distribute==0.6.10
django-celery==2.3.3
django-kombu==0.9.4
django-picklefield==0.1.9
gunicorn==0.12.2
kombu==1.4.1
psycopg2==2.4.2
pyparsing==1.5.6
python-dateutil==1.5
wsgiref==0.1.2

我将适当的celery 配置添加到我的Procfile 和settings.py 的末尾,如说明中所示。当我部署应用程序时,出现以下错误:

          Relaunching...
           Traceback (most recent call last):
             File "<string>", line 1, in <module>
           NameError: name 'install' is not defined
           Complete output from command /tmp/build_2o84wdweodb97/bin/python2.7 -c "import setuptools;__file__='/tmp/build_2o84wdweodb97/build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-LIti3K-record/install-record.txt --install-headers /tmp/build_2o84wdweodb97/include/site/python2.7:

完整的部署日志可以在此处找到:http://pastie.org/2609107

有人以前见过这个或者知道如何解决它吗?

EDIT: I narrowed down the problem to the presence of the "distribute==0.6.10" line in the requirements.txt file. Removing that line fixes the problem, and haven't run into any errors from that line not being there... yet.

I'm following the tutorial here: http://devcenter.heroku.com/articles/django

Everything was going well, until I got to the part titled "Running a Worker". I have the following in my requirements.txt file:

Django==1.3
amqplib==1.0.1
anyjson==0.3.1
celery==2.3.3
distribute==0.6.10
django-celery==2.3.3
django-kombu==0.9.4
django-picklefield==0.1.9
gunicorn==0.12.2
kombu==1.4.1
psycopg2==2.4.2
pyparsing==1.5.6
python-dateutil==1.5
wsgiref==0.1.2

And I added the appropriate celery config to the end of my Procfile and settings.py as indicated in the instructions. When I deploy the app I get the following error:

          Relaunching...
           Traceback (most recent call last):
             File "<string>", line 1, in <module>
           NameError: name 'install' is not defined
           Complete output from command /tmp/build_2o84wdweodb97/bin/python2.7 -c "import setuptools;__file__='/tmp/build_2o84wdweodb97/build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-LIti3K-record/install-record.txt --install-headers /tmp/build_2o84wdweodb97/include/site/python2.7:

The full deploy log can be found here: http://pastie.org/2609107

Anybody seen this before or know how to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

辞慾 2024-12-13 19:46:02

使用较新版本的分发解决了该问题。

distribute==0.6.21

Using a newer version of distribute fixed the problem.

distribute==0.6.21
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文