Instapy: Raspberry Pi B+ ensure chromedriver is installed

Created on 4 Apr 2019  路  22Comments  路  Source: timgrossmann/InstaPy


Expected Behavior

Current Behavior

Traceback (most recent call last): File "quickstart.py", line 8, in <module> session = InstaPy(username=insta_username, password=insta_password, headless_browser=True, nogui=False) File "/home/pi/.local/lib/python3.5/site-packages/instapy/instapy.py", line 288, in __init__ self.set_selenium_local_session() File "/home/pi/.local/lib/python3.5/site-packages/instapy/instapy.py", line 342, in set_selenium_local_session raise InstaPyError(err_msg) instapy.exceptions.InstaPyError: ensure chromedriver is installed at /home/pi/.local/lib/python3.5/site-packages/instapy_chromedriver/chromedriver

Possible Solution (optional)

I am getting the problem of the Chromedriver not being installed.
I followed the Guide on how to install it on a raspberry exactly as it mentioned (copied the driver to /home/pi/InstaPy/.../ and so on),
also i already tried headless_browser=True and nogui=True/False every possible combination.

InstaPy configuration

wontfix

Most helpful comment

hmm not sure... I have a spare pi I can try from scratch with original instructions - I'll try tomorrow for you and let you know.

I'd first attempted this more than a month ago, so need to do clean install for you, to comment. I haven't had that error code but others for sure. Best guess is chromedriver version / chrome version discrepancy.

All 22 comments

Which method did you used?

Current method available on readme doesn't require copying anything, just following the instructions and commands

I have the exact same error, using the method with Chrome for Pi B+, everything goes fine but when i run the quickstart script i get the chromedriver issue.

Same issue here. Raspberry Pi Zero W. Did all steps as recommended here: https://github.com/InstaPy/instapy-docs/blob/master/How_Tos/How_to_Raspberry.md

@andifds

Current method available on readme doesn't require copying anything, just following the instructions and commands

In line 10:

cp /home/pi/.local/lib/python3.5/site-packages/instapy_chromedriver/chromedriver assets/

Which method did you used?

Current method available on readme doesn't require copying anything, just following the instructions and commands

Yes i followed every step there, uninstalled chromedriver, installed the one mentioned there copied it in the directory and so on but still doesn't works looks like many people here have the same problem.
it might be an raspian problem

Please follow this instructions. Don't know why Readme was updated again but those instructions doesn't work.

These are the one I use on my setup and by now have been working flawless.

https://github.com/timgrossmann/InstaPy/issues/4033#issuecomment-466280659

Please follow this instructions. Don't know why Readme was updated again but those instructions doesn't work.

These are the one I use on my setup and by now have been working flawless.

#4033 (comment)

I will try this now and report later if it worked, thanks in advance
Edit: I am still getting the same Error

I got this working yesterday. Took a bit of fiddling, but the instructions sourced above got me over the line (thank you!).

One issue I had was after uninstalling chromedriver with apt, it then wasn't available to be linked to in the script, so I had to change the path to:

webdriver.Chrome('/home/pi/.local/lib/python3.5/site-packages/instapy_chromedriver/chromedriver')

Good luck!

(For completeness my full test code below)

import time
from selenium import webdriver

driver = webdriver.Chrome('/usr/local/lib/python3.5/dist-packages/instapy_chromedriver/chromedriver') 
driver.get('http://www.google.com/xhtml');
time.sleep(5) 
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5)
driver.quit()

I got this working yesterday. Took a bit of fiddling, but the instructions sourced above got me over the line (thank you!).

One issue I had was after uninstalling chromedriver with apt, it then wasn't available to be linked to in the script, so I had to change the path to:

webdriver.Chrome('/home/pi/.local/lib/python3.5/site-packages/instapy_chromedriver/chromedriver')

Good luck!

(For completeness my full test code below)

import time
from selenium import webdriver

driver = webdriver.Chrome('/usr/local/lib/python3.5/dist-packages/instapy_chromedriver/chromedriver') 
driver.get('http://www.google.com/xhtml');
time.sleep(5) 
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5)
driver.quit()

Ok tried that now i am getting following Error @uilfut:
File "quickstart.py", line 4, in <module> webdriver.Chrome('/usr/local/lib/python3.5/dist-packages/instapy_chromedriver/chromedriver') File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__ self.service.start() File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 98, in start self.assert_process_still_running() File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running % (self.path, return_code) selenium.common.exceptions.WebDriverException: Message: Service /usr/local/lib/python3.5/dist-packages/instapy_chromedriver/chromedriver unexpectedly exited. Status code was: -4

hmm not sure... I have a spare pi I can try from scratch with original instructions - I'll try tomorrow for you and let you know.

I'd first attempted this more than a month ago, so need to do clean install for you, to comment. I haven't had that error code but others for sure. Best guess is chromedriver version / chrome version discrepancy.

Any news here @uilfut ?

Hey @arsophan

I just tried it on a fresh install on pi0w (slooow install) - not working, error code -4, just like @furany

Not sure why - will keep trying and let you know if I fix this one (def working on another pi so got to be possible!)

i also tried installing it with sudo pip3 (because it is then installed in root directory), but the same error occurs, i am also fiddeling around if i get it to work i will post it here.
and thanks @uilfut for helping out :)

Hi again

I tried the same microSD card from the Pi0w in a Pi3b and my selenium test script works, so definitely some architecture issue with the Pi0w unfortunately...

I have a Pi2b here also which is in use for something else, but if helpful I can try it in that.

@uilfut Do you run your Pi3b headlessly as well?

Yes I did. But I don't use Instpy, just Selenium. If you want me to try it on a specific test script I'd be happy to, just send it to me.

import time
from selenium import webdriver

driver = webdriver.Chrome('/usr/local/lib/python3.5/dist-packages/instapy_chromedriver/chromedriver')
driver.get('http://www.google.com/xhtml');
time.sleep(5)
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5)
driver.quit()

where did you put this code? i don't get it

Can't solve this issue as well, "ensure chrome driver is installed"...
Must google chrome be installed (as opposed to chromium)? It is tricky because of armhf arq

Guys please check if you have this line in your localhost:
127.0.0.1 localhost

I was getting:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created
from disconnected: unable to connect to renderer

and it solved.

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

Just remove nogui at all and it should work.

Sent with GitHawk

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ediooo picture ediooo  路  3Comments

ingorichter picture ingorichter  路  3Comments

Spyd3r0us picture Spyd3r0us  路  3Comments

wyvers picture wyvers  路  3Comments

rahulkapoor90 picture rahulkapoor90  路  3Comments