Instapy: ensure chromedriver is installed at ...

Created on 6 Jul 2018  路  21Comments  路  Source: timgrossmann/InstaPy

pi@raspberrypi:~/Projects/InstaPy $ sudo python quickstart.py
ERROR [2018-07-06 14:50:28] [sofieke_fashion] Message: Service /home/pi/Projects/InstaPy/assets/chromedriver unexp ectedly exited. Status code was: -4
Traceback (most recent call last):
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 297, 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_st ill_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 22, in
multi_logs=True)
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 190, in __init__
self.set_selenium_local_session()
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 301, in set_selenium_local_session
Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at home/pi/Projects/InstaPy/assets/chromedriver

Can someone please help me?

Most helpful comment

@timgrossmann I did set the headless_browser=True, but still get the same error...

All 21 comments

I already uncommented "chrome_options.add_argument('--no-sandbox')"
and tried to use version 2.40 for the chromedriver...

do you properly installed google chrome and chrome driver from the link mentioned
?

I used these commands:
apt-get install chromium-browser
apt-get install chromedriver

I also tried manually downloading the driver from https://sites.google.com/a/chromium.org/chromedriver/downloads

but since I am using a raspberry py, the 64bit linux driver didn't work.

@baaswietse Simply turn headless=True in the InstaPy constructor and you're ready to go.

@timgrossmann I did set the headless_browser=True, but still get the same error...

same issue here when installing from master on a new AWS machine.
EDIT: I'm using the headless option too

Just replicated the issue. Setting headless_browser=True does not solve it unfortunately.

I had the same issue.
Follow this commands and you will be sorted

Chrome-Stable
$ cd ~
$ wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
$ sudo apt-get install -y -f
$ sudo rm google-chrome-stable_current_amd64.deb

InstaPy:
$ git clone https://github.com/timgrossmann/InstaPy.git
$ latest_version=$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -O -)
$ wget https://chromedriver.storage.googleapis.com/${latest_version}/chromedriver_linux64.zip
$ unzip chromedriver_linux64
$ mv chromedriver InstaPy/assets/chromedriver
$ chmod +x InstaPy/assets/chromedriver
$ chmod 755 InstaPy/assets/chromedriver
$ cd InstaPy
$ pip install

if you have already installed it, just follow Chrome-Stable commands and give chmod permissions to cromedriver.

If the problem still persists reinstall in the above-given order.
Also, it will be beneficial if you make this changes in a virtual environment.

Guys have you tried to change nogui=True in the instapy.py?

Same problem and I've followed all solutions. My Raspberry was reinstalled entirely. Something I can share to help finding a solution?

Change nogui=True in the instapy.py and then change headless_browser=False to True in your quickstart.py, make sure to save the files when you finished editing in the terminal

None of these worked for me. I just followed these steps https://github.com/timgrossmann/InstaPy/issues/2678#issuecomment-413777310. I think the problem came from the fact that the chromedriver was 64 bits and not ARM. Then, because it was too old, I had to downgrade the version of Chrome. So I simply followed and removed it. Worked now!

This (Setting headless_browser to true) fixed the issue for me:

--- a/instapy/instapy.py
+++ b/instapy/instapy.py
@@ -85,7 +85,7 @@ class InstaPy:
                  browser_profile_path=None,
                  page_delay=25,
                  show_logs=True,
-                 headless_browser=False,
+                 headless_browser=True,
                  proxy_address=None,
                  proxy_chrome_extension=None,
                  proxy_port=None,

Just a headsup for this issue. My guess is that none of you have google chrome installed on your system.
In my case after google chrome installation everything started working without problem.

Was this ever definitively resolved? I continue to get this issue when running on my AWS system with headless_browser=True and with the chromedriver installed in the right place with the right permissions.

File "/home/ec2-user/environment/util.py", line 28, in load_session
bypass_with_mobile=False)
File "/home/ec2-user/environment/venv/local/lib/python3.6/dist-packages/instapy/instapy.py", line 295, in __init__
self.set_selenium_local_session()
File "/home/ec2-user/environment/venv/local/lib/python3.6/dist-packages/instapy/instapy.py", line 349, in set_selenium_local_session
raise InstaPyError(err_msg)
instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/ec2-user/environment/venv/local/lib/python3.6/dist-packages/instapy_chromedriver/chromedriver_linux64

i used nogui, headless but still get this error

fixed. Updated installed google chrome in os. Redownloaded latests chromedriver from official website.

This is because instaPy needs chromedriver between 71 and 75 and the new version is 77 ... ie you should download chromedriver from an old version between 71 and 75 and replace it in folders, follow the steps below.

Steps:

1 - Download chromedriver between 71 and 75 on (https://chromedriver.storage.googleapis.com/index.html)
2 - unzip file.zip
3 - sudo rm /usr/local/lib/python3.6/dist-packages/instapy_chromedriver/chromedriver_linux64
4 - sudo mv chromedriver (file unzip on step 2) /usr/local/lib/python3.6/dist-packages/instapy_chromedriver/
5 - cd /usr/local/lib/python3.6/dist-packages/instapy_chromedriver/chromedriver_linux64
6 - sudo mv chromedriver chromedriver_linux64

Fixed
Locate the chromer
cd /usr/local/lib/python3.6/dist-packages/instapy_chromedriver/chromedriver_linux64

Remove the version on there and download latest or downgrade version
https://chromedriver.storage.googleapis.com/index.html?path=76.0.3809.68/

Copy and paste downloaded(unzip file back to (cd /usr/local/lib/python3.6/dist-packages/instapy_chromedriver/chromedriver_linux64)

You can rename the file to chromedriver_linux64 or chromedriver_Mac64

I hope this help you fix the error

on linux , mv chromedriver /home/user/InstaPy/assets
then run it , will work ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ingorichter picture ingorichter  路  3Comments

CodeMaster1 picture CodeMaster1  路  3Comments

rahulkapoor90 picture rahulkapoor90  路  3Comments

neomh picture neomh  路  3Comments

tibor picture tibor  路  3Comments