Mac上的Python代码错误我做错了什么?

2024-05-23 13:28:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我不是编码员,这是我第一次尝试编码

我按照YouTube上的一些说明,使用Python和InstaPy创建了一个自动化系统

.py文件的代码如下所示

from instapy import InstaPy

from instapy import smart_run

my_username = 'myuser'

my_password = 'mypassword'

session = InstaPy(username=my_username,

password=my_password,

headless_browser=True)

with smart_run(session):

`session.set_relationship_bounds(enable=True,`

delimit_by_numbers=True,

max_followers=600,

min_followers=30,

max_following=600)

`session.like_by_tags(['tag1', 'tag2', 'tag3', 'tag4'], amount=300)`

headless_browser=True,因为我想为我拥有的不同帐户运行多个自动机

至少,根据教程,我认为这是正确的方法

使用终端,访问文件所在桌面上的文件夹,我运行命令python3 test.py

我犯了一个很大的错误

我已经看过GtHub上的一些帖子,其中提到了mac上的错误

https://github.com/timgrossmann/InstaPy/issues/5672

我已经按照那里的说明做了,但是我仍然得到这个错误:

InstaPy Version: 0.6.13

._. ._. ._. ._. ._. ._. ._. ._.

Workspace in use: "/Users/av/InstaPy"

Error, unable to determine correct filename for 64bit macos

Traceback (most recent call last):

File "/Users/av/Desktop/InstaAuto/test.py", line 7, in <module>

session = InstaPy(username=my_username,

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/instapy.py", line 325, in __init__

self.browser, err_msg = set_selenium_local_session(

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/browser.py", line 122, in set_selenium_local_session

driver_path = geckodriver_path or get_geckodriver()

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/browser.py", line 38, in get_geckodriver

sym_path = gdd.download_and_install()[1]

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 174, in download_and_install

filename_with_path = self.download(version,

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download

download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url

raise RuntimeError(info_message)

RuntimeError: Error, unable to determine correct filename for 64bit macos

AVs-MacBook-Pro:InstaAuto av$

有人能帮我理解我该怎么做吗

非常感谢您抽出时间


Tags: inpysessiondownloadlibpackageslinelibrary
1条回答
网友
1楼 · 发布于 2024-05-23 13:28:00

这是github当前的一个问题。软件包中有两个版本的gecko驱动程序

将webdriverdownloader.py中的第320行更新为:

filename = [name for name in filenames if os_name in name and name[-12:] == 'macos.tar.gz' ]

相关问题 更多 >