4

I am trying to run a python code that uses selenium module. This code ran perfectly with the use of a chromedriver in my PC. I am trying to run it in c9.io. I downloaded the chromedriver 64 bit version and gave permissions as 777 using chmod. Still I can't get it to work

However, I get the following error:

Traceback (most recent call last):
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 119, in <module>
    op('Aaf')
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 104, in op
    plags=getplags(cd)
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 92, in getplags
    driver = webdriver.Chrome(chromedriver)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 86, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 99, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service ./chromedriver unexpectedly exited. Status code was: 127

Can anybody tell me how to fix this

Echchama Nayak
  • 971
  • 3
  • 23
  • 44

3 Answers3

6

I encountered the same issue and ran chromedriver --version gave me the exact error.

chromedriver: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

So the problem for me is the missing libraries (that chromedriver requires). So I installed those libraries and fixed the issue:

sudo yum install libX11 Gconf2 fontconfig
Tony Vu
  • 4,251
  • 3
  • 31
  • 38
  • 3
    This set me on the right track (Ubuntu 64bit) -- was missing libgconf. – Amichai Schreiber Dec 04 '16 at 19:28
  • I still have this issue with ubuntu... When I do chromedriver --version I get ` error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory ` – Krishnakumar Oct 27 '17 at 08:42
  • @AmichaiSchreiber / Tony Vu : Suggestions, might help.. thanks – Krishnakumar Oct 27 '17 at 08:43
  • @Krishnakumar follow the trail.. try installing this package, presumably something like `sudo apt install libnss3' (for Ubuntu/Debian) or `sudo yum install libnss3`. If that doesn't work, Google the library for the right name of the package. – Amichai Schreiber Oct 29 '17 at 13:39
  • @AmichaiSchreiber Let me check this out with my team and get back – Krishnakumar Nov 02 '17 at 13:04
  • @AmichaiSchreiber The chromedriver is now good... But when we run the script it still shows the same error `selenium.common.exceptions.WebDriverException: Message: Service /home/sellerp01/Desktop/chromedriver unexpectedly exited. Status code was: 127` – Krishnakumar Nov 03 '17 at 07:29
  • But giving `chromedriver --version` gives proper results now `ChromeDriver 2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4)` – Krishnakumar Nov 03 '17 at 07:30
3

I resolved this on Ubuntu 16.04 with the following:

$ sudo apt install libgconf-2-4
Hakan B.
  • 2,319
  • 23
  • 29
  • I successed with this solution when I encounter "Message: Service chromedriver unexpectedly exited. Status code was: 127". But, how can this work? – Beomi Sep 26 '17 at 14:40
  • When I do chromedriver --version I get ` error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory ` – Krishnakumar Oct 27 '17 at 08:41
0

I had the same issue but it was with the 32 bit version. Fixed it using the 64 bit version.

Tim Givois
  • 1,926
  • 2
  • 19
  • 36