---
slug: "ubuntu-selenium-geckodriver-install"
title: "ubuntu の Selenium で 'geckodriver' executable needs to be in PATH になったら"
description: "ubuntu で Selenium を Python から動かそうとして"
url: "https://www.ytyng.com/blog/ubuntu-selenium-geckodriver-install"
publish_date: "2017-02-03T00:40:42Z"
created: "2017-02-03T00:40:42Z"
updated: "2026-02-27T09:46:41.767Z"
categories: ["Linux"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/fdbd1534d06f4eb081613479ef9852f3.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "ja"
---

# ubuntu の Selenium で 'geckodriver' executable needs to be in PATH になったら

<p>ubuntu で Selenium を Python から動かそうとして</p>
<pre>Traceback (most recent call last):<br>  ... 省略 ...<br>  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__<br>    self.service.start()<br>  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 81, in start<br>    os.path.basename(self.path), self.start_error_message)<br>selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. <br><br>Exception AttributeError: "'Service' object has no attribute 'process'" in &lt;bound method Service.__del__ of &lt;selenium.webdriver.firefox.service.Service object at 0x7fd28405b350&gt;&gt; ignored</pre>
<p>となったら</p>
<pre>wget <a>https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz</a><a href="https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz"><br>tar -zxvf geckodriver-v0.14.0-linux64.tar.gz<br>sudo mv geckodriver /usr/local/bin/</a></pre>
<p></p>
<p>最新版リリースはここで確認 <a href="https://github.com/mozilla/geckodriver/releases">https://github.com/mozilla/geckodriver/releases</a></p>
<p></p>
<p>ちなみに、webdriver.Firefox のコンストラクタは</p>
<pre>    def __init__(self, firefox_profile=None, firefox_binary=None,<br>                 timeout=30, capabilities=None, proxy=None,<br>                 executable_path="geckodriver", firefox_options=None,<br>                 log_path="geckodriver.log"):<br>        """Starts a new local session of Firefox.</pre>
<p></p>
<p>こうなので、executable_path に geckodriver のフルパスを指定しても良さそう</p>
<p></p>
