Instapy: OSError=[Errno 2] No such file or directory: 'Xvfb' while executing the latest pull from GIT version of InstaPy

Created on 28 Jun 2017  Â·  8Comments  Â·  Source: timgrossmann/InstaPy

I'm trying to execute the script but run into issue with the Xvfb missing. Any idea
Below the details.

Thanks,

-- mac os Sierra 10.12.5

`
xxx @ ~/InstaPy * master
[38] → pip3.6 install pyVirtualDisplay
Requirement already satisfied: pyVirtualDisplay in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: EasyProcess in /usr/local/lib/python3.6/site-packages (from pyVirtualDisplay)

xxx @ ~/InstaPy * master
[39] → pip3.6 install xvfbwrapper
Requirement already satisfied: xvfbwrapper in /usr/local/lib/python3.6/site-packages

xxx @ ~/InstaPy * master
[40] → pip3.6 install selenium
Requirement already satisfied: selenium in /usr/local/lib/python3.6/site-packages
`

-- error while running, Xvfb missing
Apparently Xvfb is not supported.

`
xxx @ ~/InstaPy * master
[41] → pip3.6 install xvfb
Collecting xvfb
Could not find a version that satisfies the requirement xvfb (from versions: )
No matching distribution found for xvfb

[37] → python3.6 quickstart.py
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/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1326, 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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "quickstart.py", line 14, in
InstaPy(username="xxx", password="xxx", nogui=True)\
File "/Users/xxx/InstaPy/instapy/instapy.py", line 30, 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!
`

-- quickstart.py
`
from instapy import InstaPy

Write your automation here

Stuck ? Look at the github page or the examples in the examples folder

dont_like = [' food', ' girl', ' hot']
ignore_words = ['pizza']
friend_list = ['a','b','c','d']

If you want to enter your Instagram Credentials directly just enter

username= and password= into InstaPy

e.g like so InstaPy(username="instagram", password="test1234")

InstaPy(username="xxx", password="xxx", nogui=True)\
.login()\
.set_upper_follower_count(limit = 1000) \
.set_do_comment(True, percentage=10) \
.set_comments(['Cool!', 'Awesome!', 'Nice!']) \
.set_do_follow(enabled=True, percentage=10) \
.set_dont_include(friend_list) \
.set_dont_like(dont_like) \
.set_ignore_if_contains(ignore_words) \
.like_by_tags(['landscapephotography', 'streetphotography'], amount=200) \
.end()

`

help wanted

Most helpful comment

sudo apt install xvfb

All 8 comments

Have you installed it?

If not, try to install it with homebrew

I've already tried...
I'm sure someone has already managed to install it on macOS Sierra ?

xxx @ ~/InstaPy * master
[49] → brew install xvfb
Error: No available formula with the name "xvfb"
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

xxx @ ~/InstaPy * master
[50] → brew install XQuartz
Error: No available formula with the name "xquartz"
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

@viseth Could you post your quickstart file, please.

Also, if you run it on your local machine you don't need pyvirtualdisplay and xvfb

@timgrossmann it's already in my first comment. Yes I'm running it in my local machine.

-- quickstart.py
`
from instapy import InstaPy

dont_like = [' food', ' girl', ' hot']
ignore_words = ['pizza']
friend_list = ['a','b','c','d']

InstaPy(username="xxx", password="xxx", nogui=True)
.login()
.set_upper_follower_count(limit = 1000)
.set_do_comment(True, percentage=10)
.set_comments(['Cool!', 'Awesome!', 'Nice!'])
.set_do_follow(enabled=True, percentage=10)
.set_dont_include(friend_list)
.set_dont_like(dont_like)
.set_ignore_if_contains(ignore_words)
.like_by_tags(['landscapephotography', 'streetphotography'], amount=200)
.end()

`

Why do you use nogui?

Remove that from the InstaPy()

I didn't see it because if you post code on GitHub you normally do the backticks to make it a code block ;)

Thanks

Thanks @timgrossmann ! it works

sudo apt install xvfb

I got this issue then

Traceback (most recent call last):
File "quickstart.py", line 22, in
multi_logs=True)
File "/home/InstaPy/instapy/instapy.py", line 157, in __init__
self.set_selenium_local_session()
File "/home//InstaPy/instapy/instapy.py", line 261, in set_selenium_local_session
chrome_options=chrome_options)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
self.service.start()
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error

Was this page helpful?
0 / 5 - 0 ratings

Related issues

46960 picture 46960  Â·  3Comments

thisishotdog picture thisishotdog  Â·  3Comments

Naramsim picture Naramsim  Â·  3Comments

n0sw34r picture n0sw34r  Â·  3Comments

harrypython picture harrypython  Â·  3Comments