InstaPy:“错误,无法确定64位Linux的正确文件名”

okxuctiv  于 2023-01-29  发布在  Linux
关注(0)|答案(5)|浏览(154)

有人知道如何解决或修复这个问题吗?从控制台进行堆栈跟踪,执行后报告错误:

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
iibxawm4

iibxawm41#

这个问题与InstaPy无关,是webdriverdownloader中的webdriverdownloader.py,Ubuntu可以用sudo apt install firefox-geckodriver修复;其他操作系统将有类似的解决方案来安装geckodirver。
对于macOS用户,问题是由于macOS geckodriver-v0.30.0-macos.tar.gzgeckodriver-v0.30.0-macos-aarch64.tar.gz中的新arch ARM
2021年11月可用版本:

['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']

您可以使用以下代码修补GeckoDriverDownloader-〉site-packages/webdriverdownloader/webdriverdownloader.py的文件:

z4iuyo4d

z4iuyo4d2#

添加在Macos上对我有效的东西。
最简单的方法是从official latest github link下载驱动程序并解压zip文件夹。
创建一个virtualenv并在virtualenv的bin文件夹中添加geckodriver可执行文件。
您也可以使用sys.path手动添加geckodriver的路径,如下所示:

import sys
sys.path.insert(0,'/Users/myfolder/Downloads/geckodriver')

但由于某种原因,这对我来说不起作用。Virtualenv解决方案工作正常。

j8ag8udp

j8ag8udp3#

解决方案发布在此处:https://github.com/leonidessaguisagjr/webdriverdownloader/pull/12
您必须将www.example.com中的一行webdriverdownloader.py从

filename = [name for name in filenames if os_name + bitness in name]

filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]

该文件存储在我的系统中的路径为home/kali/.local/lib/python3.7/site-packages/webdriverdownloader
我使用pip3 install webdriverdriverdownloader查找它的存储位置

vddsk6oq

vddsk6oq4#

brew install geckodriver
csga3l58

csga3l585#

在macos上,什么对我有效:
/库/框架/Python.框架/版本/Python 3.9/库/Python 3.9/站点包/网络驱动程序下载器.py:
第314行将filename = [如果名称中有os_name,则文件名中的名称为name]更改为:filename = [如果名称中包含“macos”,则文件名中的名称]

相关问题