Instapy: Ensure chromedriver is installed

Created on 4 Aug 2018  路  19Comments  路  Source: timgrossmann/InstaPy

Hello :)

First i want to say I tried everything said in the #2372 issue and it didn't worked for me.
I tried everything and i still have the error of chrome driver, i use putty, and i'm trying to start the bot in headless mode, i also tried with vnc and it didn't worked.

The error :

ERROR [2018-08-04 12:06:25] [hpierre.photo] Message: Service /home/pi/Projects/InstaPy/assets/chromedriver unexpectedly exited. Status code was: -4
Traceback (most recent call last):
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 302, in set_selenium_local_session
chrome_options=chrome_options)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 86, in start
self.assert_process_still_running()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 99, in assert_process_still_running
% (self.path, return_code)
WebDriverException: Message: Service /home/pi/Projects/InstaPy/assets/chromedriver unexpectedly exited. Status code was: -4
Traceback (most recent call last):
File "quickstart.py", line 25, in
multi_logs=True)
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 195, in __init__
self.set_selenium_local_session()
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 306, in set_selenium_local_session
Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at /home/pi/Projects/InstaPy/assets/chromedriver

InstaPy configuration

Quickstart.py :

import os
import time
from tempfile import gettempdir
from selenium.common.exceptions import NoSuchElementException
from instapy import InstaPy
import random
insta_username = '--------'
insta_password = '---------'
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True,
page_delay=5,
nogui=True,
multi_logs=True)
try:
session.login()
session.set_relationship_bounds(enabled=True,
potency_ratio=-0.5,
delimit_by_numbers=True,
max_followers=15000,
max_following=15000,
min_followers=0,
min_following=0)
session.set_do_comment(True, percentage=10)
session.set_comments([''])
session.set_dont_include(['clmt_bdnl','maxime_nourrigat','teixeira_marine','jeanluc3302','hugo_castelli','sanchez.luucas','mathisalepis','constant_lb','peneraphael','popo.martin91','timothebillon','yuung_bth','anais_anaaais','_seb91940','anthooo_91','tristan.nicolle','tim.pyt','tonylvg','servaneka','raynaudmuriel5','tom_dzt','clarisseherman','nicogr2','bermond_toinou','lilian__ctr','imagxnez','killian_ttrd','benzoned','dadouboy','clauu_ng','tapia_killian','eliottiste','bttyyyyd','loan_lfb','maurinecmts','__joko','marguihr','lauralineeugene','pierrejean_bergeron','thomas_algara','arthur_lair','instaambre','morgui_g','pichy_malfoy','camille_jehanno'])
session.set_dont_like([''])
session.set_user_interact(amount=random.randint(0,2), percentage=16,randomize=True,media='Photo')
session.set_do_like(enabled=True, percentage=20)
# actions
#session.follow_likers (['brandonwoelfel', 'littleshao','lebackpacker'], photos_grab_amount = random.randint(2,12), follow_likers_per_photo = random.randint(100,200), randomize=True, sleep_delay=(random.randint(100, 3600)), interact=True)
session.unfollow_users(amount=random.randint(40, 170), nonFollowers=True, style="RANDOM", unfollow_after=60, sleep_delay=random.randint(100, 3600))
session.unfollow_users(amount=random.randint(40, 170), InstapyFollowed=(True, "all"), style="RANDOM", unfollow_after=486060, sleep_delay=random.randint(100, 3600))
except Exception as exc:
# if changes to IG layout, upload the file to help us locate the change
if isinstance(exc, NoSuchElementException):
file_path = os.path.join(gettempdir(), '{}.html'.format(time.strftime('%Y%m%d-%H%M%S')))
with open(file_path, 'wb') as fp:
fp.write(session.browser.page_source.encode('utf8'))
print('{0}\nIf raising an issue, please also upload the file located at:\n{1}\n{0}'.format(
'*' * 70, file_path))
# full stacktrace when raising Github issue
raise
finally:
# end the bot session
session.end()

settings.py :

import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class Settings:
log_location = os.path.join(BASE_DIR, 'logs')
database_location = os.path.join(BASE_DIR, 'db', 'instapy.db')
chromedriver_location = os.path.join(BASE_DIR, 'assets', 'chromedriver')
chromedriver_min_version = 2.33
# Set a logger cache outside the InstaPy object to avoid re-instantiation issues
loggers = {}
logger = None
# Set current profile credentials for DB operations
profile = {"id":None, "name":None}

wontfix

Most helpful comment

Same issue on Raspberry Pi 3, please reopened.

All 19 comments

did you put chrome drivers in asset dir?

@insology yes of course

which platform are you using? Osx? Or linux?

Raspi B+ 2 raspbian

is chrome browser install?

Yes of course too

Can you:
1) ls -lha into the InstaPy/assets folder?
2) Give the output on: google-chrome --version

Yes :)

ls -lha :

total 200K
drwxr-xr-x 13 pi pi 4,0K ao没t 4 11:49 .
drwxr-xr-x 3 pi pi 4,0K ao没t 3 21:18 ..
-rw-r--r-- 1 pi pi 12K ao没t 3 21:20 api.json
drwxr-xr-x 2 pi pi 4,0K ao没t 3 22:16 assets
-rw-r--r-- 1 pi pi 3,2K ao没t 3 21:20 CODE_OF_CONDUCT.md
drwxr-xr-x 2 root root 4,0K ao没t 3 22:19 db
-rw-r--r-- 1 pi pi 163 ao没t 3 21:20 docker-allinone.yml
-rw-r--r-- 1 pi pi 470 ao没t 3 21:20 docker-compose.yml
drwxr-xr-x 6 pi pi 4,0K ao没t 3 21:20 docker_conf
-rw-r--r-- 1 pi pi 370 ao没t 3 21:20 docker-dev.yml
-rw-r--r-- 1 pi pi 182 ao没t 3 21:20 .dockerignore
-rw-r--r-- 1 pi pi 334 ao没t 3 21:20 docker-prod.yml
-rw-r--r-- 1 pi pi 1,2K ao没t 3 21:20 docker_quickstart.py
-rw-r--r-- 1 pi pi 1,3K ao没t 3 21:20 docker-swarm.yml
drwxr-xr-x 2 pi pi 4,0K ao没t 3 21:20 docs
drwxr-xr-x 2 pi pi 4,0K ao没t 3 21:20 examples
drwxr-xr-x 8 pi pi 4,0K ao没t 3 21:20 .git
drwxr-xr-x 2 pi pi 4,0K ao没t 3 21:20 .github
-rw-r--r-- 1 pi pi 1,3K ao没t 3 21:20 .gitignore
drwxr-xr-x 2 pi pi 4,0K ao没t 4 12:05 instapy
-rw-r--r-- 1 pi pi 1,1K ao没t 3 21:20 LICENSE
drwxr-xr-x 3 pi pi 4,0K ao没t 3 22:19 logs
-rw-r--r-- 1 pi pi 50 ao没t 3 21:20 MANIFEST.in
-rw-r--r-- 1 pi pi 2,1K ao没t 3 21:20 proxy_extension.py
-rwxr-xr-x 1 pi pi 3,1K ao没t 4 12:06 quickstart.py
-rw-r--r-- 1 pi pi 66K ao没t 3 21:20 README.md
-rw-r--r-- 1 pi pi 51 ao没t 3 21:20 requirements.txt
drwxr-xr-x 2 pi pi 4,0K ao没t 3 21:20 scripts
-rw-r--r-- 1 pi pi 587 ao没t 3 21:20 setup.py
drwxr-xr-x 2 pi pi 4,0K ao没t 3 21:20 tests
-rw-r--r-- 1 pi pi 717 ao没t 3 21:20 .travis.yml
-rwxr-xr-x 1 pi pi 215 ao没t 3 21:20 wait-for-selenium.sh

google-chrome --version :

He's saying google-chrome command doesn't exist, but maybe it's because i have chromium ?

Thanks :)

I meant ls -lha assets sorry for the confusion.

@rafaelfcsouza yes there it is :

total 6,8M
drwxr-xr-x 2 pi pi 4,0K ao没t 3 22:16 .
drwxr-xr-x 13 pi pi 4,0K ao没t 4 11:49 ..
-rwsrwsrwt 1 root root 6,8M ao没t 3 22:16 chromedriver
-rw-r--r-- 1 pi pi 61 ao没t 3 21:20 .gitignore
-rw-r--r-- 1 pi pi 489 ao没t 3 21:20 unicodes.md

(chromedriver is highlighted in red on my terminal i don't know if it's important or not)

I'm having the same issue and I know that chrome and chromedriver are both downloaded and chromedriver is inside assets but I am still getting the same error that says " chromedriver is not in assets"

Can someone please help?

I am having the same issue.
But, chromedriver is right there in the assets folder

Me too! I have tried many things but nothing has worked. Help/tips?

Try this!

3312

two things:

  • you're using nogui and headless_browser, choose one, they do the same.
  • use python3

Inactive issue, reopen if you need assistance.

Same issue on Raspberry Pi 3, please reopened.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

did you put chrome drivers in asset dir?

It works, on Linux ---> mv chromedriver /home/user/InstaPy/assets
then run it .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drcyber975 picture drcyber975  路  3Comments

seuraltimez picture seuraltimez  路  3Comments

ediooo picture ediooo  路  3Comments

n0sw34r picture n0sw34r  路  3Comments

thisishotdog picture thisishotdog  路  3Comments