easyprocess.EasyProcessCheckInstalledError: cmd=[&

2019-02-16 05:18发布

问题:

I'm trying to setup a display but it's telling me No such file or directory.

Traceback (most recent call last):
  File "/var/www/envs/venv/proj/scripts/my_file.py", line 44, in click
    display = Display(visible=0, size=(800,600))
  File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 33, in __init__
    self._obj = self.display_class(
  File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 51, in display_class
    cls.check_installed()
  File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/xvfb.py", line 38, in check_installed
    ubuntu_package=PACKAGE).check_installed()
  File "/usr/lib/python2.6/site-packages/easyprocess/__init__.py", line 209, in check_installed
    raise EasyProcessCheckInstalledError(self)
easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
OSError=[Errno 2] No such file or directory
Program install error!

回答1:

You likely need to install either the xvfb package, or possibly the xvfbwrapper:

First check and see if xvfb is installed:

Xvfb -help

If the command is not found then you can usually install the xvfb package with the following command (or whichever package manager you generally use):

sudo apt-get install xvfb

xvfbwrapper is Python wrapper for running a display inside X virtual framebuffer (Xvfb).

You can install it with:

pip install xvfbwrapper

The error you are getting seems to be a result of either the command or module not being found.



回答2:

I encountered this error on a Mac and (finally) solved it by install Xquartz: https://www.xquartz.org/ (reboot after install!)