1

I'm using Python 2.7 on Windows 7 SP1 and I've installed pyvirtualdisplay and Selenium properly however when I run this script :

from pyvirtualdisplay import Display
display = Display(visible=1, size=(800, 600))
display.start()

I get this error :

Traceback (most recent call last):
  File "C:\Python27\hoho - Copie.py", line 2, in <module>
    display = Display(visible=1, size=(800, 600))
  File "build\bdist.win32\egg\pyvirtualdisplay\display.py", line 34, in __init__
    self._obj = self.display_class(
  File "build\bdist.win32\egg\pyvirtualdisplay\display.py", line 52, in display_class
    cls.check_installed()
  File "build\bdist.win32\egg\pyvirtualdisplay\xephyr.py", line 30, in check_installed
    ubuntu_package=PACKAGE).check_installed()
  File "build\bdist.win32\egg\easyprocess\__init__.py", line 180, in check_installed
    raise EasyProcessCheckInstalledError(self)
EasyProcessCheckInstalledError: cmd=['Xephyr', '-help']
OSError=[Error 2] No such file or directory
Program install error! 
>>> 
halfer
  • 19,824
  • 17
  • 99
  • 186
Fienda
  • 87
  • 1
  • 3
  • 9
  • I've googled it to see if anyone has faced the same problem, some people say you gotta install XQuartz and you'll be good, but this app is for mac, is there any similar app for windows ? – Fienda Jan 19 '18 at 09:58

1 Answers1

-1

I found a way to fix this, download chromedriver.exe and copy it in your path folder, then change this :

from pyvirtualdisplay import Display
display = Display(visible=1, size=(800, 600))
display.start()

to

from selenium import webdriver
chrome_path = r"C:\Python27\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)

:)

Fienda
  • 87
  • 1
  • 3
  • 9