Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'LifoQueue' object has no attribute 'put' selenium webdriver

I have installed selenium and the chrome web driver and made it accessible via the path variable of my operating system (using Linux virtual machine on windows and python3). I run this simple code and get the below error. Any ideas as to what may cause this error?

Thanks in advance!

Selenium version installed: selenium-3.141.0 urllib3-1.25.8

Chrome driver installed (latest version for chrome browser 80) : ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882})

Chrome browser installed : Google Chrome 80.0.3987.132

Python version : Python 3.6.9

import selenium
from selenium import webdriver

options = webdriver.chrome.options.Options()

options.add_argument('--no-sandbox') 
options.add_argument('--disable-dev-shm-usage')

chromedriver = '/usr/bin/chromedriver'

print('test0') #is being printed

driver = webdriver.Chrome('/usr/bin/chromedriver',options=options)

print('test') #not being printed

driver.get('http:google.com')

Error message when running the code : The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.

Error message 2

When I try to run google-chrome with (sudo google-chrome) I get this message: [56:56:0316/235226.650275:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Error message 3

I tried modifying the google-chrome file in the /usr/bin but it is read-only so the workaround I found online was to add the options '--no-sandbox' in my code above. But hasn't resolved the issue.

Resolved : had a python file named queue in working directory and had to rename it Error message

like image 683
Nicole Douglas Avatar asked Mar 12 '26 20:03

Nicole Douglas


1 Answers

Solution:

This error "AttributeError: 'LifoQueue' object has no attribute 'put' selenium webdriver" is caused by having in your working directory a file with the name Queue. Rename that.

For this error "The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed."

If you tried all possible solutions and still get issues then if you are using Linux virtual machine that seems to be causing the problem and I suggest to install docker desktop on windows and download a docker image with all the libraries you will be needing to run selenium apps .

like image 83
Nicole Douglas Avatar answered Mar 16 '26 00:03

Nicole Douglas