0

I have a problem using "Xvfb" with Selenium. In my requirement i have to open python with a bash script. if i execute it normally python like

python file.py

it doesn't have any problem, but if i execute it directly from bash the following error happens

start error <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[Errno 2] No such file or directory return_code=None stdout="None" stderr="None" timeout_happened=False>

I don't know what happends, my code in python (where the error appears)

display = Display(visible=0, size=(800, 600))
display.start()

and bash script

#!/bin/bash
PYTHON="/usr/bin/python"
MODULE="/home/user/file.py"
$PYTHON $MODULE

I will be grateful for any response

Edit: Full message in Except

Problem to open browser: start error <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[Errno 2] No such file or directory return_code=None stdout="None" stderr="None" timeout_happened=False>
EXCEPTION IN (main.py, LINE 2148 "display = Display(visible=0, size=(800, 600))"): start error <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[Errno 2] No such file or directory return_code=None stdout="None" stderr="None" timeout_happened=False>
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot). There are other useful information. – furas Apr 08 '20 at 21:26
  • first check if `python -V` and `/usr/bin/python -V` shows the same version of Python. – furas Apr 08 '20 at 21:26
  • do you run it as the same user ? Directly in terminal/console and not in `cron` or other manager? With the same privilages? In the same virtualenv - or without virtualenv? – furas Apr 08 '20 at 21:30
  • @furas i run it in terminal, without virtualenv and the same user and privilages. Python version 2.7.13 in python -v and /usr/bin/python -V – Javier Lepe Sabando Apr 08 '20 at 21:33

0 Answers0