【发布时间】:2020-09-30 02:49:15
【问题描述】:
当尝试在 Docker 容器中运行通过 nbconvert 运行 export_png 的 Jupyter 笔记本时,我收到以下错误。
Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.
我有一个配置了类似依赖项的 Linux 虚拟机,并且一切正常。如果路径指向脚本,我发现在查找 firefox 时存在错误,但我的没有,如下面的最后几行输出所示。我开始认为产生的运行时错误是一个红鲱鱼,它实际上抛出了一个不同的错误,但硬编码到该消息中。
在 docker 图像中运行 bokeh export_png 是否有任何已知问题?有什么必要的配置吗?任何人都可以使用您可以分享的 firefox、geckodriver、selenium 和 bokeh 版本成功地做到这一点?安装 chromium 并不容易,因为这一切都在没有这些软件包的公司 conda 镜像后面。
/opt/conda/lib/python3.7/site-packages/bokeh/io/webdriver.py in get(self)
116 if not self.reuse or self.current is None:
117 self.reset()
--> 118 self.current = self.create()
119 return self.current
120
/opt/conda/lib/python3.7/site-packages/bokeh/io/webdriver.py in create(self, kind)
120
121 def create(self, kind: Optional[DriverKind] = None) -> WebDriver:
--> 122 driver = self._create(kind)
123 self._drivers.add(driver)
124 return driver
/opt/conda/lib/python3.7/site-packages/bokeh/io/webdriver.py in _create(self, kind)
138 return driver
139
--> 140 raise RuntimeError("Neither firefox and geckodriver nor a variant of chromium browser and " \
141 "chromedriver are available on system PATH. You can install the former " \
142 "with 'conda install -c conda-forge firefox geckodriver'.")
RuntimeError: Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.
RuntimeError: Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.
[g_de_auto@0ff0d47b4a0f data_science_foundation]$ which firefox
/opt/conda/bin/FirefoxApp/firefox
[g_de_auto@0ff0d47b4a0f data_science_foundation]$ which geckodriver
/opt/conda/bin/geckodriver
[g_de_auto@0ff0d47b4a0f data_science_foundation]$ cat /opt/conda/bin/FirefoxApp/firefox
ELF>@@1@8
@@@@@@h@@@@@@ @ @-=@=@-=@=@0@@DDPtd` ` @` @<<QtdRtd-=@=@PP/lib64/ld-linux-x86-64.so.2GNU GNUB
m5Jzq
ms- libpthread.so.0__errno_locationlibdl.so.2__gmon_start__libstdc++.so.6libm.so.6libgcc_s.so.1libc.so.6execv__stack_chk_fail_]`@@D]fD`@@UH`@@HHHH?HHtHt @@(@@0@@8@@@@@H@H/Ht5/%/@%/h%/h%/h%/h%/h%/h%/h%R/f1I^HHPTI@Hp@H@fDU`@@H=`@@HtHt
17dH%(H;tf.DAWAAVIAUIATL%(+UH-(+SL)1H]HtLLDAHH9u[]A\A]A^A_ff./proc/self/exeCouldn't find the application directory.
-binExec failed with error: %s
更新 我从 _try_create_firefox_webdriver 函数中得到的基本错误是 SessionNotCreatedException('Unable to find a matching set of capabilities')
【问题讨论】:
-
我想知道是否有一个标志可以传递给 docker run 以启用图形子系统或自定义 Web 驱动程序选项来解决此问题。仍然没有工作。在运行命令中尝试了 --gpus all,但尝试时出现错误。
-
尝试决定是使用 Xvfb 作为虚拟帧缓冲区并在导出中进行一些相关的配置更改,还是使用 Kaleido。我还没有找到适用于 Bokeh 的 Kaleido 范围或任何与 Kaleido 导出的 Bokeh 相关示例。