【问题标题】:Syntax Error during Plumi/Plone buildoutPlumi/Plone 构建期间的语法错误
【发布时间】:2015-07-14 16:48:08
【问题描述】:

我正在尝试安装基于 Plone 的 Plumi 4.5.1。

目标系统是:

3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64

(Debian GNU/Linux 8)

我正在关注本指南

https://mgogoulos.trinket.io/plumi-4-5#/installation/installation

在成功完成所有前面的步骤之后,当我尝试在第 4 步中运行构建时,如下所示:

./bin/python bootstrap.py && ./bin/buildout -v

我得到这个错误:

root@suhail:/home/plumi/PLUMI/plumi.app# ./bin/python  bootstrap.py && ./bin/buildout -v
Traceback (most recent call last):
  File "bootstrap.py", line 61, in <module>
    ).read() in ez
  File "<string>", line 1
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

有没有人可以给我一个提示?

看起来 bootstrap.py 被读取为 HTML 文件 (!?)。

我已经尝试删除并重新克隆存储库。

【问题讨论】:

  • bootstrap.py 尝试加载 Python 脚本并执行它,但加载失败,因为返回的是 HTML。也许 Plumi 引导脚本已过时,并且指向不再有效的 URL。
  • 嗨 Marijn 感谢您的回复!我在 bootstrap.py 中看到了这个,除了 ImportError: ez = {} exec urllib2.urlopen('python-distribute.org/distribute_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True ) 这是我在 bootstrap.py 中可以找到的唯一 URL,它无效我尝试浏览它并显示一个 HTML 页面。也许这就是问题所在?我正在寻找该文件的另一个版本,它现在没有损坏。
  • bootstrap.py 中第 61 行的 URL 重定向到 HTML 页面,而不是 distribute_setup.py 文件。您可以尝试将 URL 替换为 this one

标签: python linux plone buildout


【解决方案1】:

Plumi 引导脚本尝试从过时的 URL 安装 setuptools

exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
                     ).read() in ez

域名python-distribute.org 现在重定向到链接场。

Plumi 项目应尽快修复其引导脚本,但您可以通过将 URL 替换为 https://bitbucket.org/pypa/setuptools/raw/f657df1f1ed46596d236376649c99a470662b4ba/distribute_setup.py 作为临时解决方法,在本地修复此问题。这是official buildout 1.x bootstrap.py now uses的URL。

域名消失了,因为distribute 早已死去;它是 setuptools 的一个分支,合并回主项目。

【讨论】:

  • 嗨 Martijn,感谢您对此进行检查并解释了如何使用引导脚本。我会写在 Plumi 邮件列表上并要求尽快解决这个问题。至于现在我尝试使用puzzlepalace提供的链接并且它有效(svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/…),构建终于被执行了!
  • 我现在陷入了一些我认为的 python 包构建问题,但我会为此打开另一个问题 :-(
  • 提供的 URL 拼图是我提供的旧版本(版本 0.6.14 与 0.6.49 分发);我提供的链接是setuptools 的官方存储库,其中distribute 合并到。
  • 好的!将链接替换为 bitbucket.org/pypa/setuptools/raw/… 并重试构建。使用此链接也可以成功开始构建:-)
  • 现在您将获得“更新的”distutils 版本,其中包含更多修复作为奖励。 :-) 很高兴能帮上忙!
猜你喜欢
  • 2017-05-20
  • 2019-11-14
  • 2012-10-14
  • 1970-01-01
  • 1970-01-01
  • 2012-09-19
  • 1970-01-01
  • 2023-02-11
  • 1970-01-01
相关资源
最近更新 更多