系统相关
首页 > 系统相关> > Windows中的Python XVFB错误

Windows中的Python XVFB错误

作者:互联网

对于虚拟Framebuffer(无头测试),我正在使用Xvfb和PyVirtualDisplay,它在Ubuntu中工作正常,但在Windows7中显示错误.这是问题发生的代码的一部分.

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

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

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有什么不同?

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

解决方法:

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

标签:xvfb,python,python-2-7,pyvirtualdisplay
来源: https://codeday.me/bug/20191008/1870688.html