ponty / PyVirtualDisplay

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

File not found error using PyvirtualDisplay in windows #56

Closed jalalk98 closed 2 years ago

jalalk98 commented 3 years ago
C:\Users\Jalal\.conda\envs\chatter_bot\python.exe C:/Users/Jalal/PycharmProjects/chatbot_with_questions_suggestions/temp.py
Traceback (most recent call last):
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\easyprocess\__init__.py", line 169, in start
    cmd, stdout=stdout, stderr=stderr, cwd=self.cwd, env=self.env,
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Jalal/PycharmProjects/chatbot_with_questions_suggestions/temp.py", line 3, in <module>
    xephyr=Display(visible=1, size=(320, 240)).start()
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\pyvirtualdisplay\display.py", line 58, in __init__
    **kwargs
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\pyvirtualdisplay\xephyr.py", line 45, in __init__
    extra_args=extra_args,
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\pyvirtualdisplay\abstractdisplay.py", line 87, in __init__
    helptext = get_helptext(program)
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\pyvirtualdisplay\util.py", line 10, in get_helptext
    p.call()
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\easyprocess\__init__.py", line 141, in call
    self.start().wait(timeout=timeout)
  File "C:\Users\Jalal\.conda\envs\chatter_bot\lib\site-packages\easyprocess\__init__.py", line 174, in start
    raise EasyProcessError(self, "start error")
easyprocess.EasyProcessError: start error <EasyProcess cmd_param=['Xephyr', '-help'] cmd=['Xephyr', '-help'] oserror=[WinError 2] The system cannot find the file specified return_code=None stdout="None" stderr="None" timeout_happened=False>

Process finished with exit code 1
The-Compiler commented 3 years ago

Looks like your code is trying to start Xephyr:

Traceback (most recent call last):
File "C:/Users/Jalal/PycharmProjects/chatbot_with_questions_suggestions/temp.py", line 3, in
xephyr=Display(visible=1, size=(320, 240)).start()

But it's not installed on your system. I doubt this is going to work on Windows FWIW.

jalalk98 commented 3 years ago

i have a GUI script which i want to run as an background.

what dependencies are missing. what should i install ? is there an seperate Xephyr download required for the script to run ?

`from pyvirtualdisplay import Display

xephyr=Display(visible=1, size=(320, 240)).start()`
The-Compiler commented 3 years ago

Yes it is - if you don't want a window, you'll probably want Xvfb, though. They won't run natively under Windows (perhaps with WSL, but not sure).

jalalk98 commented 3 years ago

From where i can install xephyr or other dependencies to make my code run on windows , or how can i make my GUI automation run without disturbing my usual work.

The-Compiler commented 3 years ago

You're pretty much out of luck on Windows, as far as I know.

ponty commented 3 years ago

Check the README: "pyvirtualdisplay is a python wrapper for Xvfb, Xephyr and Xvnc", so first you have to install the program you want to wrap. These programs are for X Window System, I don't think you want to use it on Windows.

jalalk98 commented 3 years ago

any alternatives for windows ?

DobroAlex commented 3 years ago

@jalalk98 , why would you want to use xvfb on Windows? You already have a window manager to run GUI apps directly, without doing any tricks.