charlesbel / Microsoft-Rewards-Farmer

A simple bot that uses selenium to farm Microsoft Rewards written in Python
MIT License
936 stars 245 forks source link

[BUG] Main.py not detecting undetected_chromedriver #424

Open GreenSussy opened 6 months ago

GreenSussy commented 6 months ago

Before submitting a bug report...

Title

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 undetectedchromedriver as uc File "C:\Users\toni\AppData\Roaming\Python\Python312\site-packages\undetected_chromedriver__init__.py", line 44, in from .patcher import ISPOSIX 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.undetectedchromedriver 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

MCTRACO commented 6 months ago

Same issue

02tz commented 6 months ago

install setuptools

recklessop commented 6 months ago

install setuptools

I have setuptools installed, but still have the issue.

alfaplays commented 6 months ago

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 commented 6 months ago

@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 openfunc(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 commented 6 months ago

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 commented 6 months ago

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

GreenSussy commented 6 months ago

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

@alfaplays image

Yes, I verified that undetected chromedriver is uninstalled.

RiotRuth commented 5 months ago

is your chrome version up too date?

Sunny-Shani commented 5 months ago

Same issue my friend, any fixes?

SapitoSucio commented 5 months ago

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

Sunny-Shani commented 5 months ago

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

Thankyou so much :) This is working.

GreenSussy commented 5 months ago

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

xnegx commented 2 months ago

Same issue

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

aymaners commented 2 months ago

Same issue

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

same problem

naughtok commented 1 month ago

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 commented 1 month ago

yeah. just install version 1.7.0 of blinker

naughtok commented 1 month ago

might have to downgrade selenium too

tiipolp commented 3 weeks ago

@naughtok installing 1.7 blinker worked for me, thanks alot