Python .vdisplay.start()中出错-xvfbwrapper未工作

Python .vdisplay.start()中出错-xvfbwrapper未工作,python,selenium,xvfb,Python,Selenium,Xvfb,已安装xvfbwrapper python模块。在MAC中的python selenium测试中提供显示开始 from xvfbwrapper import Xvfb class San(unittest.TestCase): def setUp(self): #display = Display(visible=0, size=(1480, 2000)) #display.start() self.vdisplay = Xvfb(wid

已安装xvfbwrapper python模块。在MAC中的python selenium测试中提供显示开始

from xvfbwrapper import Xvfb

class San(unittest.TestCase):
    def setUp(self):
        #display = Display(visible=0, size=(1480, 2000))
        #display.start()
        self.vdisplay = Xvfb(width=1480, height=2000)
        self.vdisplay.start()
        self.driver = webdriver.Chrome()
运行测试用例时,会发生错误

Traceback (most recent call last):
  File "san98.py", line 34, in setUp
    self.vdisplay.start()
  File "/Library/Python/2.7/site-packages/xvfbwrapper.py", line 53, in start
    stderr=open(os.devnull),
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
如何解决此问题

试试这个

sudo apt-get install xvfb

你解决这个问题了吗?