Sultan Morbiwala
Sultan Morbiwala

Reputation: 171

How to fix geckodriver error when running InstaPy on raspberry pi OS?

I installed InstaPy recently and downloaded one standard script on the internet. I know that there is nothing wrong with opensource code and on forums it says to download geckodriver. However, I haven't found a suitable solution to install geckodriver so can you guys let me know the best way to fix this?

Error:

>>> %Run basic_follow_unfollow_activity.py
InstaPy Version: 0.6.13
 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/pi/InstaPy"
Error, unable to determine correct filename for 32bit linux
Traceback (most recent call last):
  File "/home/pi/Desktop/basic_follow_unfollow_activity.py", line 36, in <module>
    headless_browser=False)
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/instapy.py", line 338, in __init__
    geckodriver_log_level,
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/browser.py", line 122, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/browser.py", line 38, in get_geckodriver
    sym_path = gdd.download_and_install()[1]
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install
    show_progress_bar=show_progress_bar)
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
    download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
    raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 32bit linux

I tried following solutions:

  1. This link on forum to install geckodriver - https://www.raspberrypi.org/forums/viewtopic.php?t=167292

  2. Installed firefox ESR in terminal - sudo apt-get install firefox-esr

Upvotes: 0

Views: 2362

Answers (2)

Sultan Morbiwala
Sultan Morbiwala

Reputation: 171

Installing Geckodrive instruction is given on instapy documentation through this link - https://github.com/InstaPy/instapy-docs/blob/master/How_Tos/How_to_Raspberry.md

GeckoDriver releases can be found in: https://github.com/mozilla/geckodriver/releases. The latest ARM release as of 2019-08-16 is v0.23.

Follow these steps:

1) wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-arm7hf.tar.gz
2) tar -xvzf geckodriver-v*
3) chmod +x geckodriver
4) sudo cp geckodriver /usr/local/bin/

Ensure that /usr/local/bin is in your shell PATH

Install InstaPy

1) sudo apt-get install python3-pip
2) python3 -m pip install --user instapy
3) sudo reboot (optional)

Finishing up the Firefox installation

1) sudo pip3 install future
2) sudo apt-get install xvfb
3) sudo pip3 install pyvirtualdisplay

Upvotes: 0

shiny
shiny

Reputation: 688

I've had similar problems to get the geckodriver running on my Pi. If i remember correctly there was a problem with the ARM support. I ended up switching to chromedriver.

you can easily install it with:
sudo apt install chromium-chromedriver

after that you can use it without any executable_path like this:

from selenium import webdriver

driver = webdriver.Chrome()

Upvotes: 1

Related Questions