ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
697 stars 78 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'xmessage' #71

Closed YangQY320 closed 1 year ago

YangQY320 commented 2 years ago

When I try to run python3 -m pyvirtualdisplay.examples.headless, I got this error. Is this error caused by my xvfb? I'm not sure my xvfb is installed correctly.

Traceback (most recent call last): File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/site-packages/easyprocess/init.py", line 176, in start self.popen = subprocess.Popen( File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'xmessage'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/site-packages/pyvirtualdisplay/examples/headless.py", line 8, in with EasyProcess(["xmessage", "hello"]) as proc: File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/site-packages/easyprocess/init.py", line 380, in enter self.start() File "/home/yangqiuyu/anaconda3/envs/minerl/lib/python3.8/site-packages/easyprocess/init.py", line 186, in start raise EasyProcessError(self, "start error") easyprocess.EasyProcessError: start error <EasyProcess cmd_param=['xmessage', 'hello'] cmd=['xmessage', 'hello'] oserror=[Errno 2] No such file or directory: 'xmessage' return_code=None stdout="None" stderr="None" timeout_happened=False>

ponty commented 2 years ago

"FileNotFoundError: [Errno 2] No such file or directory: 'xmessage'" You should install xmessage for this example.

On Ubuntu 20.04:

$ sudo apt install x11-utils

Ι updated the README.