【问题标题】:AttributeError: 'dict_values' object has no attribute 'extend' - repo syncAttributeError: 'dict_values' 对象没有属性 'extend' - repo 同步
【发布时间】:2020-12-11 00:44:10
【问题描述】:

我正在尝试运行 repo init 和 repo sync 命令,但遇到了以下问题:

repo init -u <git-url> -b release -m <manifest-xml> --repo-url=<url> --repo-branch=<branch>

我收到以下错误

gpg: Can't check signature: No public key
fatal: cloning the git-repo repository failed, will remove '.repo/repo'

但后来我关注了这些 steps 并能够让它工作,但后来 repo sync 现在失败了

repo sync

warning: Python 3 support is currently experimental. YMMV.
Please use Python 2.6 - 2.7 instead.
Traceback (most recent call last):
  File "/home/tmp/.repo/repo/main.py", line 500, in <module>
    _Main(sys.argv[1:])
  File "/home/tmp/.repo/repo/main.py", line 476, in _Main
    result = repo._Run(argv) or 0
  File "/home/tmp/.repo/repo/main.py", line 155, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home//tmp/.repo/repo/subcmds/sync.py", line 624, in Execute
    submodules_ok=opt.fetch_submodules)
  File "/home/tmp/.repo/repo/command.py", line 148, in GetProjects
    all_projects_list.extend(derived_projects.values())
AttributeError: 'dict_values' object has no attribute 'extend'

这是否意味着我现在需要使用 python 2?我认为 repo 版本 1.22 需要 python 3.6+

this a safe 解决了吗?

我什至尝试了this solution 无济于事

【问题讨论】:

  • 您阅读警告了吗? warning: Python 3 support is currently experimental. YMMV.
  • 是的,但是python -V 是 2.7.12
  • 虽然python -V 可能会报告2.7.12,但repo 获得的python 版本是3.something。您可能想弄清楚为什么会出现这种情况并首先解决它。 (virtualenv 技巧不起作用似乎很奇怪——这就是我通常自己处理这些 Python 版本问题的方式,它在多个操作系统中对我来说都很好。)
  • 这很奇怪,因为我必须升级到 python 3.6 才能使最初的 repo init 命令工作,而现在 repo sync 似乎需要 python 2.x

标签: python linux git repo


【解决方案1】:

我遇到了同样的repo sync 问题。但是,就我而言,该场景非常具体,因为我最初已经检查了源代码树,然后只是想通过运行repo sync 来确保它是最新的。 我的问题似乎是我在初始和有问题的repo sync 之间执行的回购工具升级。似乎有一些不兼容阻止我更新已经签出的树。幸运的是,初始化新的源代码树并从头开始repo sync-ing 运行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-01
    • 2021-04-19
    • 2021-11-22
    • 1970-01-01
    • 1970-01-01
    • 2018-08-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多