Solving The Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited

Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited is an error which occurs when you have a faulty ChromeDriver installation.

In this article, I am going to help you solve this error and understand the root of the problem, also I am presenting other possible solutions that may work if the main solution does not work for you.

Explaining the Error : Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited

The problem happens when you do not have the proper version of chromedriver.

The error message should look like the error in the example bellow.

                                                                       #
selenium.common.exceptions.SessionNoteCreatedException: Message: session not 
created exception: Chrome version must be >= 59.0.3071.0
(Driver info: chromedriver=2.43,platform=Linux 4.9.35-v7+ armv7l)
                                                                       #

In the sections bellow we will explain the root of the error more and propose some possible fixes.

Solution 1 : if you are using Raspberry Pi

If you have Raspberry Pi you need the version of chromedriver that works for arm devices and boards.

Bellow you can find that version.

https://github.com/electron/electron/releases/download/v1.6.0/chromedriver-v2.21-linux-armv7l.zip

You can now use chromedriver in Raspberry Pi within your program.

If this solution has worked for you, great. If it did not, try the solution bellow.

Solution 2 : general step by step fix

Download then unzip chromedriver and set path to the driver as follows.

                                                                       #
webdriver.Chrome('/home/user/drivers/chromedriver')
ChromeDriverManager(path=custom_path).install()
                                                                       #

Run the following command.

                                                                       #
pip install webdriver-manager
                                                                       #

Add this code to work with webdriver with Chromium.

                                                                       #
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
driver = webdriver.Chrome(ChromeDriverManager
(chrome_type=ChromeType.CHROMIUM).install())
                                                                       #

Add this code to work with webdriver with Chrome.

                                                                       #
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
                                                                       #

I hope the solutions above fixed your problem, good luck with the scripts to come.

Summing-up

If you have to go against the recommendations in the Python documentation and want to use relative imports, just know that the first solution solved the error for me and most other developers who had this issue.

I hope you found a solution in our article, keep creating and keep coding, cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/