aydinnyunus / WhatsappBOT

Send messages to any person in any time how much you want.
439 stars 104 forks source link

run error #2

Closed pretech86 closed 4 years ago

pretech86 commented 4 years ago

thanks for the tool but when i run python3 WhatsappBot.py i get the following error , i already run pip3 install -r requirments.txt with no error

Traceback (most recent call last): File "WhatsappBot.py", line 35, in gif1 = tk.PhotoImage(file='GZd3Pv.png') File "/usr/lib/python3.7/tkinter/init.py", line 3545, in init Image.init(self, 'photo', name, cnf, master, **kw) File "/usr/lib/python3.7/tkinter/init.py", line 3501, in init self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't open "GZd3Pv.png": no such file or directory

aydinnyunus commented 4 years ago

I fixed requirements.txt please install again the libraries with "pip install -r requirements.txt". If this does not work.Please say me which options fixed your problem and I fixed for github repository.

For Linux:

Enter terminal and "pip install python-tk".

For Windows :

https://tkdocs.com/tutorial/install.html

pretech86 notifications@github.com, 13 Mar 2020 Cum, 16:08 tarihinde şunu yazdı:

thanks for the tool but when i run python3 WhatsappBot.py i get the following error

Traceback (most recent call last): File "WhatsappBot.py", line 2, in import tkinter as tk File "/usr/lib/python2.7/dist-packages/tkinter/init.py", line 5, in from Tkinter import * File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in raise ImportError, str(msg) + ', please install the python-tk package' ImportError: No module named _tkinter, please install the python-tk package

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aydinnyunus/WhatsappBOT/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTAGVIUWJU5HFQMISTYSDTRHIV3FANCNFSM4LHCFDDQ .

pretech86 commented 4 years ago

i already installed requirments and python-tk but also get this

Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/python-tk/

aydinnyunus commented 4 years ago

I fixed the codes please try again with new codes.Your problem was path of photos.

pretech86 commented 4 years ago

i install python-tk successfully but when i run python3 WhatsappBot.py i get this error

Traceback (most recent call last): File "WhatsappBot.py", line 40, in canvas1.create_image(400, 350, image=gif2) NameError: name 'gif2' is not defined

aydinnyunus commented 4 years ago

Last time try again my bad.

pretech86 commented 4 years ago

i start already also i changed the path of the chromwebdriver inside the python file but when i try to send message i got this error

Exception in Tkinter callback Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 76, in start stdin=PIPE) File "/usr/lib/python3.7/subprocess.py", line 800, in init restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: '/opt/WhatsappBOT/chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "WhatsappBot.py", line 104, in Driver driver = webdriver.Chrome(executable_path="/opt/WhatsappBOT/chromedriver") File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

aydinnyunus commented 4 years ago

Try in terminal "sudo python3 WhatsappBot.py"

aydinnyunus commented 4 years ago

This is not code error.

pretech86 commented 4 years ago

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

aydinnyunus commented 4 years ago

You need to change path of webdriver on python file.

driver = webdriver.Chrome(executable_path="/home/aydinnyunus/Downloads/Birthday-master/chromedriver") to

driver = webdriver.Chrome(executable_path="YOUR PATH")

aydinnyunus commented 4 years ago

This requirements are at READ.me

pretech86 commented 4 years ago

i already installed chromedriver and put the path in the script but still get this error

Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "WhatsappBot.py", line 104, in Driver driver = webdriver.Chrome(executable_path="/usr/local/lib/node_modules/chromedriver/bin/chromedriver") File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 98, in start self.assert_process_still_running() File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running % (self.path, return_code) selenium.common.exceptions.WebDriverException: Message: Service /usr/local/lib/node_modules/chromedriver/bin/chromedriver unexpectedly exited. Status code was: 1

aydinnyunus commented 4 years ago

Solution : https://stackoverflow.com/questions/49323099/webdriverexception-message-service-chromedriver-unexpectedly-exited-status-co

It seems chromedriver needs some extra libraries. This solved the issue for me:

apt-get install -y libglib2.0-0=2.50.3-2 \ libnss3=2:3.26.2-1.1+deb9u1 \ libgconf-2-4=3.2.6-4+b1 \ libfontconfig1=2.11.0-6.7+b1

pretech86 commented 4 years ago

thanks for your kindly interest , and i'm really sorry to interrupt you but i got the following error

E: Version '2:3.26.2-1.1+deb9u1' for 'libnss3' was not found

aydinnyunus commented 4 years ago

Do you have chromium ? Download it : sudo apt-get install -y chromium-browser

pretech86 commented 4 years ago

sorry for delaying , but i try it many times , i install google chrome and download chromedriver and put its path in the script but , google chrom not start untill i write --n0-sandbox

and i get the following error

WhatsappBot.py:108: DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Chrome(executable_path="/root/WhatsappBOT/chromedriver_linux64/chromedriver", options=options) Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "WhatsappBot.py", line 108, in Driver driver = webdriver.Chrome(executable_path="/root/WhatsappBOT/chromedriver_linux64/chromedriver", options=options) File "/usr/lib/python3/dist-packages/selenium/webdriver/chrome/webdriver.py", line 100, in init desired_capabilities=desired_capabilities) File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 152, in init self.start_session(capabilities, browser_profile) File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 249, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 318, in execute self.error_handler.check_response(response) File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

aydinnyunus commented 4 years ago

I add some new codes.Change user data to your User Data Path.If you don't want to change just delete options part.

pretech86 commented 4 years ago

i already installed chrome and it run , i get the following error

hatsappBot.py:108: DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Chrome(executable_path="/usr/local/lib/node_modules/chromedriver", options=options) Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 76, in start stdin=PIPE) File "/usr/lib/python3.7/subprocess.py", line 800, in init restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: '/usr/local/lib/node_modules/chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "WhatsappBot.py", line 108, in Driver driver = webdriver.Chrome(executable_path="/usr/local/lib/node_modules/chromedriver", options=options) File "/usr/lib/python3/dist-packages/selenium/webdriver/chrome/webdriver.py", line 92, in init self.service.start() File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

aydinnyunus commented 4 years ago

try with sudo

pretech86 commented 4 years ago

i try sudo and try chmod 777 also but oi get the same error ? sorry for interrupting you

pretech86 commented 4 years ago

root@kali:~/WhatsappBOT1# sudo python3 WhatsappBot.py WhatsappBot.py:108: DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver", options=options) Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "WhatsappBot.py", line 108, in Driver driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver", options=options) File "/usr/lib/python3/dist-packages/selenium/webdriver/chrome/webdriver.py", line 92, in init self.service.start() File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 98, in start self.assert_process_still_running() File "/usr/lib/python3/dist-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running % (self.path, return_code) selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: 1