我能够在运行 Ubuntu 20.04 LTS 的 Oracle Ampere Compute VM(ARM 处理器)上安装InstaPy 。当我尝试运行时quickstart.py
,它显示了以下错误:
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
InstaPy Version: 0.6.15
._. ._. ._. ._. ._. ._. ._. ._.
Workspace in use: "/home/ubuntu/InstaPy"
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 71, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/geckodriver'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "quickstart.py", line 5, in <module>
session = InstaPy(username='XXX', password='XXX', headless_browser=True)
File "/home/ubuntu/.local/lib/python3.8/site-packages/instapy/instapy.py", line 327, in __init__
self.browser, err_msg = set_selenium_local_session(
File "/home/ubuntu/.local/lib/python3.8/site-packages/instapy/browser.py", line 123, in set_selenium_local_session
browser = webdriver.Firefox(
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
self.service.start()
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
我必须安装适用于 ARM 处理器的旧版本geckodriver/usr/local/bin/geckodriver
,它是可执行的并且存在于PATH
. 我该如何解决这个问题?
编辑:这就是它所显示的echo $PATH
ubuntu@oracleampere:~$ echo $PATH
/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/bin/geckodriver
ubuntu@oracleampere:~$ geckodriver
-bash: /usr/local/bin/geckodriver: No such file or directory
ubuntu@oracleampere:~$