【问题标题】:aap - python troubleaap - 蟒蛇的麻烦
【发布时间】:2009-08-15 21:00:29
【问题描述】:

我正在尝试运行 aap 应用程序。版本是 1.076(尝试更高版本)。所有命令都会向我发送一个错误,例如:

> Traceback (most recent call last):  
> File "/usr/bin/aap", line 10, in
> <module>
>     import Main   File "/usr/share/aap/Main.py", line 14, in
> <module>
>     from DoAddDef import doadddef   File "/usr/share/aap/DoAddDef.py",
> line 10, in <module>
>     from Action import find_primary_action   File
> "/usr/share/aap/Action.py", line 30,
> in <module>
>     from Dictlist import listitem2str, str2dictlist, dictlist2str   File
> "/usr/share/aap/Dictlist.py", line 18,
> in <module>
>     from Process import recipe_error   File "/usr/share/aap/Process.py", line
> 13, in <module>
>     from Work import setrpstack   File "/usr/share/aap/Work.py", line 25, in
> <module>
>     from Node import Node   File "/usr/share/aap/Node.py", line 10, in
> <module>
>     import Filetype   File "/usr/share/aap/Filetype.py", line
> 1417
>     as = 0
>      ^ SyntaxError: invalid syntax

会是什么问题?

【问题讨论】:

标签: python linux


【解决方案1】:

好吧,as 是 Python 中的保留字。所以,不能在 FileType.py 中用作变量名。

尝试更新您的 aap 安装或写信给 aap 作者/论坛。

【讨论】:

  • 我使用了不同版本的软件。好的,我给开发者发消息
【解决方案2】:

as 是 Python 中的 reserved word

似乎 aap-application 是为 Python 2.5 和以下版本编写的:

在 2.5 版中已更改:aswith 仅在 with_statement 未来功能已启用时才会被识别 启用。 它将始终在 Python 2.6。请参阅与 详细说明。请注意,使用 as 和 with as 标识符将始终 发出警告,即使 with_statement 未来指令不是 有效。

【讨论】:

    猜你喜欢
    • 2013-06-09
    • 2010-10-27
    • 2023-04-02
    • 2010-10-21
    • 2016-05-28
    • 2014-08-01
    • 2021-06-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多