---
slug: "python-selenium-chromedriver-error-127-install-libgconf2"
title: "Python selenium ChromeDriver がエラー127 で起動しない場合、libgconf2 をインストール"
description: "Ubuntu 14.04 で Selenium ChromeDriver が status 127 で起動しない原因は `libgconf-2.so.4` の不在。`sudo apt install libgconf2-4` で解決する。"
url: "https://www.ytyng.com/blog/python-selenium-chromedriver-error-127-install-libgconf2"
publish_date: "2017-09-11T08:35:49Z"
created: "2017-09-11T08:35:49Z"
updated: "2026-05-11T12:03:41.460Z"
categories: ["Django", "Linux"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250605/b922cbda61c5449e895726a32f67b5bc.png.webp?width=768"
has_video: true
has_music: true
video_urls: ["https://media.ytyng.net/ytyng-blog/117/featured-video-1.mp4", "https://media.ytyng.net/ytyng-blog/117/featured-video-2.mp4", "https://media.ytyng.net/ytyng-blog/117/featured-video-3.mp4"]
music_urls: ["https://media.ytyng.net/ytyng-blog/117/featured-music-117-3.mp3", "https://media.ytyng.net/ytyng-blog/117/featured-music-117-4.mp3"]
lang: "ja"
---

# Python selenium ChromeDriver がエラー127 で起動しない場合、libgconf2 をインストール

<p>ubuntu 14.04</p>
<p>Python で、selenium ChromeDriver を起動しようとして</p>
<pre>$ xvfb-run ipython</pre>
<pre>In [3]: from selenium.webdriver import Chrome<br /><br />In [4]: d = Chrome()<br />---------------------------------------------------------------------------<br />WebDriverException&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Traceback (most recent call last)<br />&lt;ipython-input-4-0dc1ed148f2d&gt; in &lt;module&gt;()<br />----&gt; 1 d = Chrome()<br /><br />/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.pyc in __init__(self, executable_path, port, chrome_options, service_args, desired_capabilities, service_log_path)<br />&nbsp;&nbsp;&nbsp;&nbsp; 60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service_args=service_args,<br />&nbsp;&nbsp;&nbsp;&nbsp; 61&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log_path=service_log_path)<br />---&gt; 62&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.service.start()<br />&nbsp;&nbsp;&nbsp;&nbsp; 63<br />&nbsp;&nbsp;&nbsp;&nbsp; 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br /><br />/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.pyc in start(self)<br />&nbsp;&nbsp;&nbsp;&nbsp; 94&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count = 0<br />&nbsp;&nbsp;&nbsp;&nbsp; 95&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while True:<br />---&gt; 96&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.assert_process_still_running()<br />&nbsp;&nbsp;&nbsp;&nbsp; 97&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.is_connectable():<br />&nbsp;&nbsp;&nbsp;&nbsp; 98&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break<br /><br />/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.pyc in assert_process_still_running(self)<br />&nbsp;&nbsp;&nbsp; 107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise WebDriverException(<br />&nbsp;&nbsp;&nbsp; 108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Service %s unexpectedly exited. Status code was: %s'<br />--&gt; 109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; % (self.path, return_code)<br />&nbsp;&nbsp;&nbsp; 110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br />&nbsp;&nbsp;&nbsp; 111<br /><br />WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127</pre>
<p></p>
<p>となったら。</p>
<p></p>
<p>まず、chromedriver 単体で起動してみる</p>
<pre>$ chromedriver<br />chromedriver: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory</pre>
<p>&rarr; 起動失敗</p>
<p></p>
<p>libgconf2 をインストール</p>
<pre>$ apt search libgconf<br /><br />...<br /><br />$ sudo apt install libgconf2-4</pre>
<p></p>
<p>chromedriver を再実行してみる</p>
<pre>$ chromedriver<br />Starting ChromeDriver 2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5) on port 9515<br />Only local connections are allowed.</pre>
<p>起動した!</p>
<p></p>
<p>再度Python から実行</p>
<pre>$ xvfb-run ipython</pre>
<pre>In [1]: from selenium.webdriver import Chrome<br /><br />In [2]: d = Chrome()<br /><br />In [3]:</pre>
<p>&nbsp;起動した!</p>
