Instapy: Xvfb is missing in instapy_web docker container

Created on 18 Aug 2017  Â·  3Comments  Â·  Source: timgrossmann/InstaPy

Created the docker images with docker-compose --verbose up -d --build but there is an error running docker_quickstart.py

Did anybody see this before? I don't remember when I created the docker files the last time, but back then it was no issue. Perhaps a simple apt-get install xvfb in the docker file might help. But I don't understand why it was working before.

» docker logs 83ff16351554                                                                                                                                                                                ◉
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/easyprocess/__init__.py", line 225, in start
    env=self.env,
  File "/usr/local/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.6/subprocess.py", line 1333, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'Xvfb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/easyprocess/__init__.py", line 178, in check_installed
    self.call()
  File "/usr/local/lib/python3.6/site-packages/easyprocess/__init__.py", line 194, in call
    self.start().wait(timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/easyprocess/__init__.py", line 230, in start
    raise EasyProcessError(self, 'start error')
easyprocess.EasyProcessError: start error <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[Errno 2] No such file or directory: 'Xvfb' return_code=None stdout="None" stderr="None" timeout_happened=False>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker_quickstart.py", line 17, in <module>
    bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False, nogui=True)
  File "/code/instapy/instapy.py", line 48, in __init__
    self.display = Display(visible=0, size=(800, 600))
  File "/usr/local/lib/python3.6/site-packages/pyvirtualdisplay/display.py", line 34, in __init__
    self._obj = self.display_class(
  File "/usr/local/lib/python3.6/site-packages/pyvirtualdisplay/display.py", line 52, in display_class
    cls.check_installed()
  File "/usr/local/lib/python3.6/site-packages/pyvirtualdisplay/xvfb.py", line 38, in check_installed
    ubuntu_package=PACKAGE).check_installed()
  File "/usr/local/lib/python3.6/site-packages/easyprocess/__init__.py", line 180, in check_installed
    raise EasyProcessCheckInstalledError(self)
easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
OSError=[Errno 2] No such file or directory: 'Xvfb'
Program install error!
help wanted

Most helpful comment

Be sure to

bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')

from your error it seems that you are instantiating instapy likebot= InstaPy(username='test', password='test', nogui=True)

All 3 comments

Be sure to

bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')

from your error it seems that you are instantiating instapy likebot= InstaPy(username='test', password='test', nogui=True)

Traceback (most recent call last):
File "quickstart.py", line 3, in
session = InstaPy(username='**
', password='**')
File "C:\Users\Ting\Desktop\InstaPy-master\instapy\instapy.py", line 47, in __init__
self.display = Display(visible=0, size=(800, 600))
File "C:\Users\Ting\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyvirtualdisplay\display.py", line 34, in __init__
self._obj = self.display_class(
File "C:\Users\Ting\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyvirtualdisplay\display.py", line 52, in display_class
cls.check_installed()
File "C:\Users\Ting\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyvirtualdisplay\xvfb.py", line 38, in check_installed
ubuntu_package=PACKAGE).check_installed()
File "C:\Users\Ting\AppData\Local\Programs\Python\Python36-32\lib\site-packages\easyprocess__init__.py", line 180, in check_installed
raise EasyProcessCheckInstalledError(self)
easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
OSError=[WinError 2] The system cannot find the file specified
Program install error!

C:\Users\Ting\Desktop\InstaPy-master>Xvfb -help
'Xvfb' is not recognized as an internal or external command,
operable program or batch file.**

also having a similar problem

@Naramsim you are totally correct. It was my mistake with the added nogui=True argument. Sorry for that.

Thanks for your help. Let's close this issue. :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drcyber975 picture drcyber975  Â·  3Comments

Spyd3r0us picture Spyd3r0us  Â·  3Comments

thisishotdog picture thisishotdog  Â·  3Comments

neomh picture neomh  Â·  3Comments

46960 picture 46960  Â·  3Comments