Forums

How to install XVFB?

Hello, Greetings! I have subscribed to the hacker account. I am trying to use selenium in headless mode using xvfb. But when I try to run my python code using "xvfb-run -a python3.6 /home/myusername/myfolder/myscript.py" this way, it gives the below error.

bash: xvfb: command not found

Can someone please guide me how I can get xvfb running?

Thanks in advance. Regards, Krishnan

Are you sure you haven't put a space into the command accidentally? Bash is saying it can't find a command called "xvfb", which would suggest that instead of running

xvfb-run -a python3.6 /home/myusername/myfolder/myscript.py

You're actually running

xvfb -run -a python3.6 /home/myusername/myfolder/myscript.py

(Note the space after xvfb.)