vic1707 / AutoPlay-PokeMeow-Discord

A bot that plays PokeMeow for you
15 stars 19 forks source link

ModuleNotFoundError: No module named 'pyotp' #37

Open BloodGodMoon opened 2 years ago

BloodGodMoon commented 2 years ago

Classes\CustomDriver.py", line 5, in from pyotp import TOTP ModuleNotFoundError: No module named 'pyotp'

vic1707 commented 2 years ago

did you even read the README, guess no since you didn't even used the issue template ? pyotp isn't by default on your computer you need to install it...

python -m pip install -r requirements.txt Windows or python3 -m pip install -r requirements.txt MAC/Linux

BloodGodMoon commented 2 years ago

sorry,my english actually no good at all and i dont understand where i need to type python -m pip install -r requirements.txt

BloodGodMoon commented 2 years ago

type in the cmd or where?

BloodGodMoon commented 2 years ago

i type in cmd and i get python.exe: No module named pip

vic1707 commented 2 years ago

not having a good english isn't really an excuse for not reading a README... mine isn't perfect neither (french)

then you have to install pip https://phoenixnap.com/kb/install-pip-windows

BloodGodMoon commented 2 years ago

It's 18:37:44, working time ! Traceback (most recent call last): File "C:\Users\wongj\bot.py", line 39, in DRIVER = CustomDriver(ARGUMENTS) File "C:\Users\wongj\Classes\CustomDriver.py", line 49, in init webdriver.Firefox.init(self, executable_path=path_binary, options=options) File "D:\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in init RemoteWebDriver.init( File "D:\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "D:\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "D:\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "D:\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

BloodGodMoon commented 2 years ago

at the last i get this

BloodGodMoon commented 2 years ago

Is that complete?

vic1707 commented 2 years ago

do you have firefox on your computer? did you download every file i provided?

BloodGodMoon commented 2 years ago

I use opera....., i change fire fox

vic1707 commented 2 years ago

you really didn't read the readme... firefox is used by default and requires to be installed on your computer, if you want to use opera you'll have to add -D "Opera" at the end of the python command

BloodGodMoon commented 2 years ago

i read already and i also change the -D to opera already but not work so i change fire fox now

BloodGodMoon commented 2 years ago

It's 23:05:57, working time ! Traceback (most recent call last): File "C:\Users\wongj\bot.py", line 39, in DRIVER = CustomDriver(ARGUMENTS) File "C:\Users\wongj\Classes\CustomDriver.py", line 72, in init self.DiscordLogin(self.CHANNEL) File "C:\Users\wongj\Classes\CustomDriver.py", line 77, in DiscordLogin self.get(CHANNEL) File "D:\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get self.execute(Command.GET, {'url': url}) File "D:\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "D:\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor: 'XXXXXXX' is not a valid URL.

BloodGodMoon commented 2 years ago

i can confirm the link is same and right

BloodGodMoon commented 2 years ago

but why still cannot

BloodGodMoon commented 2 years ago

wait....i think i know whats wrong maybe i need to register a firefox account and log in to keep the discord log in history

BloodGodMoon commented 2 years ago

oh,i know whats wrong,dont write the link in the quotes

vic1707 commented 2 years ago

can you send the full command you used? (hide your email and password the rest can be raw)

BloodGodMoon commented 2 years ago

python bot.py -U 'JY' -M '-------' -P '------' -C -------

BloodGodMoon commented 2 years ago

but know i clear the quotes

vic1707 commented 2 years ago

the channel should be in quotes (as well as every parameter) and containing "https://discord ......" (which is why I told discord link can be raw : wanted to see if you've only set the IDs)

BloodGodMoon commented 2 years ago

know already can open until into the discord but.....

BloodGodMoon commented 2 years ago

It's 23:20:56, working time ! Traceback (most recent call last): File "C:\Users\wongj\Classes\CustomDriver.py", line 99, in FindOneByXPATH return WebDriverWait(self, timeout=timeout).until(EC.element_to_be_clickable((By.XPATH, PATH))) File "D:\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\wongj\bot.py", line 39, in DRIVER = CustomDriver(ARGUMENTS) File "C:\Users\wongj\Classes\CustomDriver.py", line 73, in init self.SEND_MSG_BAR = self.FindOneByXPATH(self.SEND_MSG_BAR_XPATH, 'Discord sending bar') File "C:\Users\wongj\Classes\CustomDriver.py", line 100, in FindOneByXPATH except TimeoutException: raise Exception(f'"{ item }" took too much time to apear, dev can\'t really do anything to fix it') Exception: "Discord sending bar" took too much time to apear, dev can't really do anything to fix it

vic1707 commented 2 years ago

Exception: "Discord sending bar" took too much time to apear, dev can't really do anything to fix it I love when people just send error messages without any other infos, you understand that you're only making my life difficult by doing so? What whas displayed on the browser window before the crash ? did it go through the login page? is there a pop-up or something?

BloodGodMoon commented 2 years ago

it can login and go to the right channel but stop at there and no any pop up so i go to take a look at CMD and it shows me that..........

vic1707 commented 2 years ago

but stop

immediately? after some time?

BloodGodMoon commented 2 years ago

python bot.py -U JY -M XXX -P XXX -C https://discord.com/channels/744114974758273034/744114974758273037

BloodGodMoon commented 2 years ago

this is the command

BloodGodMoon commented 2 years ago

it just login and go to the right channel and stop at there and do not do anything else

vic1707 commented 2 years ago

so it waits some time before crashing right?

BloodGodMoon commented 2 years ago

i though it will start to auto catch but it did not do anything

BloodGodMoon commented 2 years ago

no crashing

vic1707 commented 2 years ago

wait, never? no crashes at all ? the browser window never crashes?

BloodGodMoon commented 2 years ago

yes

BloodGodMoon commented 2 years ago

just stop at the channel

BloodGodMoon commented 2 years ago

it auto open discord and auto login and auto go to the channel that i want and just stop at there,the browser no close and no crash

vic1707 commented 2 years ago

i updated the script try with the new version

BloodGodMoon commented 2 years ago

image_2022-03-24_233918

BloodGodMoon commented 2 years ago

it stop at here and then the CMD show me that thing that just now i send

BloodGodMoon commented 2 years ago

ok,i try the new script

BloodGodMoon commented 2 years ago

It's 23:48:58, working time ! Traceback (most recent call last): File "C:\Users\wongj\Classes\CustomDriver.py", line 105, in FindMessages return WebDriverWait(self, timeout=timeout).until(lambda driver: driver.find_elements_by_xpath(self.MSG_XPATH))[::-1] File "D:\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\wongj\bot.py", line 39, in DRIVER = CustomDriver(ARGUMENTS) File "C:\Users\wongj\Classes\CustomDriver.py", line 74, in init self.LAST_MSG = self.FindMessages('find last message')[0] File "C:\Users\wongj\Classes\CustomDriver.py", line 106, in FindMessages except TimeoutException: raise Exception(f'"{ item }" took too much time to apear, dev can\'t really do anything to fix it') Exception: "find last message" took too much time to apear, dev can't really do anything to fix it

vic1707 commented 2 years ago

and? do you remember what i said about just getting an error message? "doc it hurts" this is as helpfull as this

vic1707 commented 2 years ago

script updated which should fix the error, be warned next error if you only give an error message I'll close the issue without answering

BloodGodMoon commented 2 years ago

sorry.......same eror...........just stop at the channel only.......

BloodGodMoon commented 2 years ago

so how can i fix it.........

vic1707 commented 2 years ago

new update but can't be sure if it'll work

BloodGodMoon commented 2 years ago

Ok

BloodGodMoon commented 2 years ago

I will try

vic1707 commented 2 years ago

So, did it work ?

BloodGodMoon commented 2 years ago

no....same error again.....