Mac上的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$

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

非常感谢您抽出时间。

这是github上当前的问题。有两个版本的壁虎驱动器与包装。

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

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

最新更新