Instapy: Install InstaPy on a Raspberry

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

Hi,
Can you help me to install InstaPy on a raspberry please ?
I follow all steps to install InstaPy but I have always the same error.
Thanks for your help !

InstaPy configuration

from instapy import InstaPy

insta_username = 'myaccount'
insta_password = 'mypwd'

session = InstaPy(username=insta_username, password=insta_password, headless_browser=True)
session.login()

session.set_relationship_bounds(enabled=True,
                 potency_ratio=-1.21,
                  delimit_by_numbers=True,
                   max_followers=4590,
                    max_following=5555,
                     min_followers=45,
                      min_following=77)
session.set_do_comment(True, percentage=10)
session.set_comments(['aMEIzing!', 'So much fun!!', 'Nicey!'])
session.set_dont_include(['friend1', 'friend2', 'friend3'])
session.set_dont_like(['pizza', 'girl'])

session.like_by_tags(['natgeo', 'world'], amount=100)

session.end()

Logs

ERROR [2018-08-14 23:07:46] [myaccount]  Message: session not created exception
from tab crashed
  (Session info: headless chrome=68.0.3440.75)
  (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.14.52-v7+ armv7l)
Traceback (most recent call last):
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 300, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: session not created exception
from tab crashed
  (Session info: headless chrome=68.0.3440.75)
  (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.14.52-v7+ armv7l)

Traceback (most recent call last):
  File "quickstart.py", line 6, in <module>
    session = InstaPy(username=insta_username, password=insta_password, headless_browser=True)
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 193, in __init__
    self.set_selenium_local_session()
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 304, in set_selenium_local_session
    Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at /home/pi/Projects/InstaPy/assets/chromedriver

Most helpful comment

finally made it!!
i reversed the tutorial https://github.com/timgrossmann/InstaPy/blob/master/docs/How_to_Raspberry.md
sudo apt-get remove PACKAGE sudo apt autoremove

When everything was clear, including chromium, wolfram (wolfram-engine) and libreoffcie(libreoffice*), i follwed the last point of the tutorial:

Installation with raspbian stretch lite (v4.14)
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install chromium-browser python-pip git
git clone https://github.com/timgrossmann/InstaPy.git instapy
in the instapy folder: pip install .
in the assets folder: wget https://github.com/electron/electron/releases/download/v3.0.0-beta.5/chromedriver-v3.0.0-beta.5-linux-armv7l.zip
also in the assets folder: unzip chromedriver-v3.0.0-beta.5-linux-armv7l.zip
馃帀

AND IT WORKS!! Thanks Tim for your grat work

All 19 comments

install python 3

Start with next command:
sudo python3 quickstarter.py

Thanks.
Still doesn't work with sudo python3 quickstart.py

Traceback (most recent call last):
  File "quickstart.py", line 5, in <module>
    from selenium.common.exceptions import NoSuchElementException
ImportError: No module named 'selenium'

I tried

sudo pip install selenium
Requirement already satisfied: selenium in /usr/local/lib/python2.7/dist-packages

Next I tried
sudo pip3 install .
sudo python3 quickstart.py

ERROR [2018-08-15 22:59:29] [myaccount]  Message: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.14.52-v7+ armv7l)
Traceback (most recent call last):
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 300, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.14.52-v7+ armv7l)

Traceback (most recent call last):
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 300, in set_selenium_local_session
    chrome_options=chrome_options)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.14.52-v7+ armv7l)


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "quickstart.py", line 22, in <module>
    multi_logs=True)
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 193, in __init__
    self.set_selenium_local_session()
  File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 304, in set_selenium_local_session
    Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at /home/pi/Projects/InstaPy/assets/chromedriver

Did you validate that the chromedriver is in the assets directory per the last line of the error?

Yes chromedriver is in /assets

I'm having the exact same problem, following

which pi are you using? i have the 3 B+ and i cant get it to work. same error. Depends which file i use for chromedriver

3 b+

finally made it!!
i reversed the tutorial https://github.com/timgrossmann/InstaPy/blob/master/docs/How_to_Raspberry.md
sudo apt-get remove PACKAGE sudo apt autoremove

When everything was clear, including chromium, wolfram (wolfram-engine) and libreoffcie(libreoffice*), i follwed the last point of the tutorial:

Installation with raspbian stretch lite (v4.14)
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install chromium-browser python-pip git
git clone https://github.com/timgrossmann/InstaPy.git instapy
in the instapy folder: pip install .
in the assets folder: wget https://github.com/electron/electron/releases/download/v3.0.0-beta.5/chromedriver-v3.0.0-beta.5-linux-armv7l.zip
also in the assets folder: unzip chromedriver-v3.0.0-beta.5-linux-armv7l.zip
馃帀

AND IT WORKS!! Thanks Tim for your grat work

Followed your written guide step for step, but I still get the error, 'ensure chromedriver is installed at /home/pi/instapy/assets/chromedriver' :(

edit, after removing, chromium and libreoffice* the script worked. hurray 馃帀

It works for me too ! Thanks

Dont work for me :(

Yaaay, this worked!!

Doesnt work for me. Still same error

Followed your written guide step for step, but I still get the error, 'ensure chromedriver is installed at /home/pi/instapy/assets/chromedriver' :(

edit, after removing, chromium and libreoffice* the script worked. hurray 馃帀

I could start after removing these apps as well

I added this configuration, in my case is Raspberry Pi 3 B+ and executing in SSH shell.

session = InstaPy(username=insta_username,
                  password=insta_password,
                  nogui=False,
                  headless_browser=True)

finally made it!!
i reversed the tutorial https://github.com/timgrossmann/InstaPy/blob/master/docs/How_to_Raspberry.md
sudo apt-get remove PACKAGE sudo apt autoremove

When everything was clear, including chromium, wolfram (wolfram-engine) and libreoffcie(libreoffice*), i follwed the last point of the tutorial:

Installation with raspbian stretch lite (v4.14)
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install chromium-browser python-pip git
git clone https://github.com/timgrossmann/InstaPy.git instapy
in the instapy folder: pip install .
in the assets folder: wget https://github.com/electron/electron/releases/download/v3.0.0-beta.5/chromedriver-v3.0.0-beta.5-linux-armv7l.zip
also in the assets folder: unzip chromedriver-v3.0.0-beta.5-linux-armv7l.zip
馃帀

AND IT WORKS!! Thanks Tim for your grat work

this worked. thank you

@MrJamsn & @wiggers96 : You got my InstaPy working!

The commands that got it to work were to (as you both said) remove chromium & libreoffice:

sudo apt-get remove chromium
sudo apt-get remove libreoffice

Was this page helpful?
0 / 5 - 0 ratings