Windows 中的 Python XVFB 错误 [英] Python XVFB error in windows

查看:80
本文介绍了Windows 中的 Python XVFB 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于虚拟帧缓冲区(无头测试),我使用 XvfbPyVirtualDisplay,它在 Ubuntu 中运行良好,但在 Windows7 中显示错误.这是发生问题的部分代码.

For virtual Framebuffer (headless testing) I'm using Xvfb with PyVirtualDisplay and it's working fine in Ubuntu but showing error in Windows7. here is part of code where problem is occurring.

from pyvirtualdisplay import Display
display = Display(visible=1, size=(300, 400))
display.start() 

但是当我在 Windows 中运行相同的命令时,我收到此错误

but when I run same command in Windows, I get this error

Traceback (most recent call last):
  File "C:\Python27\Scripts\pynt-script.py", line 9, in <module>
    load_entry_point('pynt==0.8.0', 'console_scripts', 'pynt')()
  File "C:\Python27\lib\site-packages\pynt\_pynt.py", line 295, in main
    build(sys.argv[1:])
  File "C:\Python27\lib\site-packages\pynt\_pynt.py", line 48, in build
    module = imp.load_source(path.splitext(path.basename(args.file))[0], args.fi
le)
  File "build.py", line 7, in <module>
    display = Display(visible=1, size=(300,400))
  File "C:\Python27\lib\site-packages\pyvirtualdisplay\display.py", line 33, in
__init__
    self._obj = self.display_class(
  File "C:\Python27\lib\site-packages\pyvirtualdisplay\display.py", line 50, in
display_class
    cls.check_installed()
  File "C:\Python27\lib\site-packages\pyvirtualdisplay\xvfb.py", line 34, in che
ck_installed
    ubuntu_package=PACKAGE).check_installed()
  File "C:\Python27\lib\site-packages\easyprocess\__init__.py", line 209, in che
ck_installed
    raise EasyProcessCheckInstalledError(self)
easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
OSError=[Error 2] The system cannot find the file specified
Program install error! 

我认为我的程序无法找到 xvfb 程序/库?我安装了 xvfbwrapper (https://github.com/cgoldberg/xvfbwrapper) 但问题仍然存在.我再次认为 xvfbwrapper 与 xvfb 不同?

I think my program is not able to find xvfb program/library ? I installed xvfbwrapper (https://github.com/cgoldberg/xvfbwrapper) but problem still remain same. again I think xvfbwrapper is different from xvfb?

Windows 平台的任何替代方案,可以进行无头测试(虚拟帧缓冲区)

Any alternative for Windows platform which can do headless testing (virtual framebuffer)

推荐答案

因为命令 Xvfb 未找到.Xvfb 是 X 虚拟帧缓冲区,它不是 Microsoft Windows 7 的一部分.

You get an error because command Xvfb was not found. Xvfb is X virtual framebuffer which is not a part of Microsoft Windows 7.

这篇关于Windows 中的 Python XVFB 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆