Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Main.py not detecting undetected_chromedriver #424

Open
2 tasks done
GreenSussy opened this issue Dec 31, 2023 · 19 comments
Open
2 tasks done

[BUG] Main.py not detecting undetected_chromedriver #424

GreenSussy opened this issue Dec 31, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@GreenSussy
Copy link

Before submitting a bug report...

  • This bug wasn't already reported.
    (I have checked every bug report on GitHub)

Title

  • The title is no longer "[BUG] Title" and I edited it with the right error name.

Describe the bug

Upon running main.py after installing all requirements, I get this error (it's in VSCode so I could see the error)
image

Yes, I have correctly installed all requirements including undetected_chromedriver. Any fixes?

Copy and paste your error

PS C:\Users\toni_\Downloads> & "C:/Program Files/Python312/python.exe" c:/Users/toni_/Downloads/Microsoft-Rewards-Farmer-master/main.py
Traceback (most recent call last):
File "C:\Users\toni_\AppData\Roaming\Python\Python312\site-packages\seleniumwire\undetected_chromedriver\webdriver.py", line 6, in
import undetected_chromedriver as uc
File "C:\Users\toni_\AppData\Roaming\Python\Python312\site-packages\undetected_chromedriver_init_.py", line 44, in
from .patcher import IS_POSIX
File "C:\Users\toni_\AppData\Roaming\Python\Python312\site-packages\undetected_chromedriver\patcher.py", line 4, in
from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 9, in
from src import Browser, DailySet, Login, MorePromotions, PunchCards, Searches
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\src_init_.py", line 1, in
from .browser import Browser
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\src\browser.py", line 9, in
import seleniumwire.undetected_chromedriver as webdriver
File "C:\Users\toni_\AppData\Roaming\Python\Python312\site-packages\seleniumwire\undetected_chromedriver_init_.py", line 1, in
from .webdriver import Chrome, ChromeOptions
File "C:\Users\toni_\AppData\Roaming\Python\Python312\site-packages\seleniumwire\undetected_chromedriver\webdriver.py", line 8, in
raise ImportError(
ImportError: undetected_chromedriver not found. Install it with pip install undetected_chromedriver.

Screenshots

None

Value of dashboard variable

None

@GreenSussy GreenSussy added the bug Something isn't working label Dec 31, 2023
@MCTRACO
Copy link

MCTRACO commented Jan 1, 2024

Same issue

@02tz
Copy link

02tz commented Jan 2, 2024

install setuptools

@recklessop
Copy link

install setuptools

I have setuptools installed, but still have the issue.

@alfaplays
Copy link

alfaplays commented Jan 2, 2024

just delete sessions folder and run it again, also you can verify if undetected_chromedriver is correctly installed and reconized by Code by opening a powershell terminal (with the + symbol, next to the trash bin) and typing pip install undetected_chromedriver

@GreenSussy
Copy link
Author

GreenSussy commented Jan 2, 2024

@alfaplays I cannot find a sessions folder.

@02tz Doing that gives me a new error:

PS C:\Users\toni_> & "C:/Program Files/Python312/python.exe" c:/Users/toni_/Downloads/Microsoft-Rewards-Farmer-master/main.py
Traceback (most recent call last):
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 175, in
main()
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 18, in main
setupLogging()
^^^^^^^^^^^^^^
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 40, in setupLogging
handlers.TimedRotatingFileHandler(
File "C:\Program Files\Python312\Lib\logging\handlers.py", line 214, in init
BaseRotatingHandler.init(self, filename, 'a', encoding=encoding,
File "C:\Program Files\Python312\Lib\logging\handlers.py", line 58, in init
logging.FileHandler.init(self, filename, mode=mode,
File "C:\Program Files\Python312\Lib\logging_init_.py", line 1231, in init
StreamHandler.init(self, self.open())
^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\logging_init
.py", line 1263, in open
return open_func(self.baseFilename, self.mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\toni
\logs\activity.log'

Upon creating a folder called logs with activity.log inside of it, another error appears:

PS C:\Users\toni_> & "C:/Program Files/Python312/python.exe" c:/Users/toni_/Downloads/Microsoft-Rewards-Farmer-master/main.py
Traceback (most recent call last):
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 175, in
main()
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 21, in main
loadedAccounts = setupAccounts()
^^^^^^^^^^^^^^^
File "c:\Users\toni_\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 118, in setupAccounts
loadedAccounts = json.loads(accountPath.read_text(encoding="utf-8"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 5 column 3 (char 81)

@alfaplays
Copy link

Did you verified that you have installed undetected chromedriver? Can you send a screenshot of the console complete console of Visual Studio Code? I can't see the lower part in the one you sent.

@recklessop
Copy link

Deleting the Sessions folder fixed this issue for me on Ubuntu.

@GreenSussy
Copy link
Author

@recklessop where is the sessions folder? Here is what mine looks like:
image

@alfaplays
image

Yes, I verified that undetected chromedriver is uninstalled.

@RiotRuth
Copy link

is your chrome version up too date?

@Sunny-Shani
Copy link

Same issue my friend, any fixes?

@SapitoSucio
Copy link

pip install setuptools fixed it for me, I'm using python 3.12

@Sunny-Shani
Copy link

Sunny-Shani commented Jan 31, 2024

pip install setuptools fixed it for me, I'm using python 3.12

Thankyou so much :) This is working.

@GreenSussy
Copy link
Author

@SapitoSucio that didn't work for me unfortunately. Oh well....

@xnegx
Copy link

xnegx commented Apr 30, 2024

Same issue

after pip install setuptools
the error changed to ModuleNotFoundError: No module named 'blinker._saferef'

@aymaners
Copy link

aymaners commented May 3, 2024

Same issue

after pip install setuptools the error changed to ModuleNotFoundError: No module named 'blinker._saferef'

same problem

@naughtok
Copy link

Same issue

after pip install setuptools the error changed to ModuleNotFoundError: No module named 'blinker._saferef'

https://www.marekrost.cz/selenium-wire-how-to-resolve-blinker-saferef

@naughtok
Copy link

yeah. just install version 1.7.0 of blinker

@naughtok
Copy link

might have to downgrade selenium too

@tiipolp
Copy link

tiipolp commented Jun 8, 2024

@naughtok installing 1.7 blinker worked for me, thanks alot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests