datacamp-downloader icon indicating copy to clipboard operation
datacamp-downloader copied to clipboard

AttributeError: 'Chrome' object has no attribute 'service'

Open PezAmaury opened this issue 2 years ago • 7 comments

Hi,

After updating the tool to version 3 in order to resolve the login issue, I now get this error when trying to login:

ERROR: expected str, bytes or os.PathLike object, not NoneType Exception ignored in: <function Chrome.__del__ at 0x7f1a763f4790> Traceback (most recent call last): File "/home/pezam/.local/lib/python3.8/site-packages/undetected_chromedriver/v2.py", line 623, in __del__ self.quit() File "/home/pezam/.local/lib/python3.8/site-packages/undetected_chromedriver/v2.py", line 581, in quit self.service.process.kill() AttributeError: 'Chrome' object has no attribute 'service'

I'm running Ubuntu 20.04 LTS, and the update worked without issue.

PezAmaury avatar Aug 12 '21 08:08 PezAmaury

I'm not sure what's causing the problem, but it's related to the undetected-chromedriver library. See https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/259

I would suggest installing chrome driver with the following command and please let me know if it works.

sudo apt-get install chromium-chromedriver

TRoboto avatar Aug 12 '21 13:08 TRoboto

Hey, thanks for the quick answer. This solved the above error, but I got now another one.

ERROR: Message: unknown error: cannot connect to chrome at 127.0.0.1:49466
from chrome not reachable
Stacktrace:
#0 0x7f0322192a63 <unknown>
#1 0x7f0321f072ef <unknown>
#2 0x7f0321ef61e4 <unknown>
#3 0x7f0321f2d73f <unknown>
#4 0x7f0321f25676 <unknown>
#5 0x7f0321f5fb72 <unknown>
#6 0x7f0321f59fd3 <unknown>
#7 0x7f0321f30514 <unknown>
#8 0x7f0321f31505 <unknown>
#9 0x7f03221bee2e <unknown>
#10 0x7f03221d4886 <unknown>
#11 0x7f03221bfd75 <unknown>
#12 0x7f03221d5d94 <unknown>
#13 0x7f03221b68eb <unknown>
#14 0x7f03221f0cd8 <unknown>
#15 0x7f03221f0e58 <unknown>
#16 0x7f032220adfd <unknown>
#17 0x7f0321b06609 <unknown>

The from chrome not reachable seems to be an issue with ChromeDriver and Selenium from what I gathered, so I made sure everything is compatible, as suggested here or here- Google Chrome is 92.0.4515.131; ChromeDriver is 92.0.4515.43, but the error persists although they are compatible.

So I started over in a new venv and resintalled fresh, and the error still persists as well. Below is the list of packages in the venv

Package                 Version
----------------------- ---------
async-generator         1.10
attrs                   21.2.0
beautifulsoup4          4.9.3
certifi                 2021.5.30
charset-normalizer      2.0.4
chromedriver            2.24.1
click                   7.1.2
colorama                0.4.4
datacamp-downloader     3.1
h11                     0.12.0
idna                    3.2
iniconfig               1.1.1
outcome                 1.1.0
packaging               21.0
pip                     20.0.2
pkg-resources           0.0.0
pluggy                  0.13.1
py                      1.10.0
pyparsing               2.4.7
pytest                  6.2.4
requests                2.26.0
selenium                4.0.0b4
setuptools              44.0.0
sniffio                 1.2.0
sortedcontainers        2.4.0
soupsieve               2.2.1
termcolor               1.1.0
texttable               1.6.3
tomd                    0.1.3
toml                    0.10.2
trio                    0.19.0
trio-websocket          0.9.2
typer                   0.3.2
undetected-chromedriver 3.0.3
urllib3                 1.26.6
websockets              9.1
wsproto                 1.0.0

I'm utterly clueless now to get what's happening - I also tried on another computer just in case and the same problem shows up.

PezAmaury avatar Aug 13 '21 07:08 PezAmaury

The undetected-chromedriver library should automatically install the driver binary. In your case I suppose it didn't. I'm really not sure what the problem is. We might need to wait for a solution from the author of the library.

From my side, I tried running the library on windows and linux and didn't face any issue.

TRoboto avatar Aug 13 '21 14:08 TRoboto

I have faced the same problem when using this tool with WSL (Windows Subsystem for Linux).

However, when using the tool with powershell everything works.

@PezAmaury , do you use WSL ?

mohammad-albarham avatar Aug 13 '21 20:08 mohammad-albarham

I have faced the same problem when using this tool with WSL (Windows Subsystem for Linux).

However, when using the tool with powershell everything works.

@PezAmaury , do you use WSL ?

No, I am dual booting Ubuntu 20.04 and Win 10. I ended up trying on Win 10 (no WSL) and it works so the issue seems to come from the Ubuntu side. No clue what's causing it, so probably we have to wait some fix from the other libraries. It's not an unusual issue from what I've seen so something must be in the works..

Thank you both for your help!

PezAmaury avatar Aug 14 '21 06:08 PezAmaury

@PezAmaury you need to monkeypatch undetected_chromedriver and log output of chrome subprocess to see what's happening, see https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/268

HMaker avatar Aug 18 '21 01:08 HMaker

I'm not sure what's causing the problem, but it's related to the undetected-chromedriver library. See ultrafunkamsterdam/undetected-chromedriver#259

I would suggest installing chrome driver with the following command and please let me know if it works.

sudo apt-get install chromium-chromedriver

This solve for me :)

Jao42 avatar Sep 08 '21 15:09 Jao42