PyVirtualDisplay
PyVirtualDisplay copied to clipboard
Cant instantiate Display()
When i try to use pyvritualdisplay and call Display() it gives me the following error
Traceback (most recent call last): File "test.py", line 5, in <module> disp = Display() File "C:\Users\cvssh\PycharmProjects\Trustmenot2\venv\lib\site-packages\pyvirtualdisplay\display.py", line 54, in __init__ self._obj = cls( File "C:\Users\cvssh\PycharmProjects\Trustmenot2\venv\lib\site-packages\pyvirtualdisplay\xvfb.py", line 44, in __init__ AbstractDisplay.__init__( File "C:\Users\cvssh\PycharmProjects\Trustmenot2\venv\lib\site-packages\pyvirtualdisplay\abstractdisplay.py", line 85, in __init__ helptext = get_helptext(program) File "C:\Users\cvssh\PycharmProjects\Trustmenot2\venv\lib\site-packages\pyvirtualdisplay\util.py", line 13, in get_helptext p = subprocess.Popen( File "C:\Users\cvssh\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\cvssh\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified
Have you installed Xvfb?
Have you installed Xvfb?
Windows cant install Xvfb. How to use it on Windows ? I got the same error. Thank you.
I have no idea how to install Xvfb on Windows, ask it on a Xvfb forum. This forum is for the Python wrapper.
@ponty is it possible for you to make a check condition
Example:
if pyvritualdisplay.is_ready
Just to check if virtual display is installed and ready to be used, because in production I use selenium inside linux docker image to run the python script but I run the scripts for testing and dev on windows so If I had something like this I could make it so that when virtual display is available it can use it.