Reputation: 143
Anyone knows how to solve of fix this issue? Stack trace from console, that reports an error after execution:
InstaPy Version: 0.6.9
._. ._. ._. ._. ._. ._. ._. ._. ._.
Workspace in use: "/home/zanettra/InstaPy"
Error, unable to determine correct filename for 64bit linux
Traceback (most recent call last):
File "unfollow.py", line 24, in <module>
headless_browser=False)
File "/usr/local/lib/python3.6/dist-packages/instapy/instapy.py", line
322, in __init__
self.logger,
File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 114, in set_selenium_local_session
driver_path = geckodriver_path or get_geckodriver()
File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 36, in get_geckodriver
sym_path = gdd.download_and_install()[1]
File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install
show_progress_bar=show_progress_bar)
File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 64bit linux
Upvotes: 14
Views: 16337
Reputation: 49619
in Kali linux:
download the tar file:
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
extract it to:
tar xvzf ~/Downloads/geckodriver*.tar.gz -C /tmp/
sudo chown -R root:root /tmp/geckodriver*
if you get an error, you need to install
sudo apt install eyewitness
Upvotes: 0
Reputation: 1
What works for me on macos :
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader.py :
Line 314 change filename = [name for name in filenames if os_name in name] to : filename = [name for name in filenames if 'macos' in name]
Upvotes: 0
Reputation: 478
This problem is not related to InstaPy but the webdriverdownloader.py from webdriverdownloader. For Ubuntu you can fix the problem with sudo apt install firefox-geckodriver
; Other OS will have similar solution to install the geckodirver.
For macOS users,
the problem is due to the new arch ARM in macOS geckodriver-v0.30.0-macos.tar.gz
and geckodriver-v0.30.0-macos-aarch64.tar.gz
Available versions Nov 2021:
['geckodriver-v0.30.0-linux32.tar.gz', 'geckodriver-v0.30.0-linux32.tar.gz.asc', 'geckodriver-v0.30.0-linux64.tar.gz', 'geckodriver-v0.30.0-linux64.tar.gz.asc', 'geckodriver-v0.30
.0-macos-aarch64.tar.gz', 'geckodriver-v0.30.0-macos.tar.gz', 'geckodriver-v0.30.0-win32.zip', 'geckodriver-v0.30.0-win64.zip']
You can patch the file for GeckoDriverDownloader
-> site-packages/webdriverdownloader/webdriverdownloader.py
with the following:
1 │ diff --git a/Users/user/GitHub/InstaPy/venv39/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py b/Users/user/GitHub/InstaPy/venv39/lib/python3.9/
│ site-packages/webdriverdownloader/webdriverdownloader_patch.py
2 │ index bc01c2d..057862a 100644
3 │ --- a/Users/user/GitHub/InstaPy/venv39/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py
4 │ +++ b/Users/user/GitHub/InstaPy/venv39/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader_patch.py
5 │ @@ -382,6 +382,13 @@ class GeckoDriverDownloader(WebDriverDownloaderBase):
6 │ )
7 │ logger.error(info_message)
8 │ raise RuntimeError(info_message)
9 │ + # macos is only available for 64bit, 32bit is deprectated
10 │ + # geckodriver is available for x64 and aarch64, this is why the "RuntimeError: Error, unable to determine correct filename for 64bit macos"
11 │ + # geckodriver-v0.30.0-macos.tar.gz
12 │ + # geckodriver-v0.30.0-macos-aarch64.tar.gz
13 │ + if os_name == "macos":
14 │ + bitness = ".tar.gz" # no bitness for macos since it is 64bit only. Use the extension for tar.gz
15 │ +
16 │ if len(filename) > 1:
17 │ filename = [name for name in filenames if os_name + bitness in name]
18 │ if len(filename) != 1:
Upvotes: 20
Reputation: 1
Solution is posted here: https://github.com/leonidessaguisagjr/webdriverdownloader/pull/12
You have to change a line in webdriverdownloader.py from
filename = [name for name in filenames if os_name + bitness in name]
to
filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]
The path that the file was stored in my system was home/kali/.local/lib/python3.7/site-packages/webdriverdownloader
I used pip3 install webdriverdriverdownloader
to find where it's stored
Upvotes: 0
Reputation: 22091
Adding what worked for me on Macos.
Simplest thing to do on is download the drivers from official latest github link and extract the zip folder.
Create a virtualenv and in the bin folder for the virtualenv add the geckodriver executable.
You can also manually add the path of the geckodriver using sys.path as below:
import sys
sys.path.insert(0,'/Users/myfolder/Downloads/geckodriver')
But this wasn't working for me for some reason. Virtualenv solution works fine.
Upvotes: 2