【问题标题】:Python build error while building selenium webdriver project构建 selenium webdriver 项目时 Python 构建错误
【发布时间】:2017-08-13 05:36:15
【问题描述】:

我正在尝试进入一些开源项目,作为一名 QA 工程师,我一直在研究 Appium 和 Selenium。

  • 情况:Windows 10
  • Appium:克隆的 repo,构建成功
  • Selenium:已克隆,但有问题。
  • 已安装:Java、JDK、python 3.6、Ruby、Rake gem。
  • 错误,我使用 go + 一个目标,例如“go build”、“go”或“go firefox”。但是我总是收到以下错误:

错误:

C:\Users\Mark\selenium>go build
(in C:/Users/Mark/selenium)
python C:/Users/Mark/selenium/buck-out/crazy-fun/7c1417f319649e9fd58fd3f97f36f42c870b1790/buck.pex kill
Traceback (most recent call last):
  File "C:\Users\Mark\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Mark\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Mark\selenium\buck-out\crazy-fun\7c1417f319649e9fd58fd3f97f36f42c870b1790\buck.pex\__main__.py", line 25, in <module>
  File "C:\Users\Mark\selenium\buck-out\crazy-fun\7c1417f319649e9fd58fd3f97f36f42c870b1790\buck.pex\.bootstrap\_pex\pex_bootstrapper.py", line 94, in bootstrap_pex
  File "C:\Users\Mark\selenium\buck-out\crazy-fun\7c1417f319649e9fd58fd3f97f36f42c870b1790\buck.pex\.bootstrap\_pex\finders.py", line 218, in register_finders
AttributeError: module 'importlib._bootstrap' has no attribute 'FileFinder'
go aborted!

我无法在网上找到任何类似的东西,除了一篇文章暗示旧版本的 Python 可能存在问题。不过我刚刚下载了最新的,所以不会出现问题...

【问题讨论】:

  • Selenium 构建脚本使用 Buck,需要使用 Python 2.x。它与 Python 3 不兼容。这是构建工具的限制,而不是 Selenium 项目本身。
  • @JimEvans 谢谢,Selenium 松弛频道建议我尝试降级,是的。然而,这让我有了下一个问题 buck ;)
  • @JimEvans 今天回来了,走得更远了,但我仍然卡住了(我感觉很接近!)。如果有机会:stackoverflow.com/questions/56981193/…

标签: python selenium-webdriver compiler-errors rake open-source


【解决方案1】:

此处使用的 Selenium 构建脚本(crazyfunbuild 或 buckd 取决于安装的设置和工具)使用 Python 2.7(在撰写本文时)。

从 3.6 降级到 2.7 至少解决了我的 (python) 问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-06
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-29
    相关资源
    最近更新 更多