+ 1
How to fix 'DISPLAY' error in python while using pywhatkit
10 ответов
+ 4
okay. can you list the entire error? That might help. this could be a python exception with a traceback or actually an error deeper in the API.
+ 2
a python exception traceback looks like this:
Traceback (most recent call last):
file ‘cat_life.py’ line 42, in react():
self.bark(mailman)
AttributeError: Jaywright has no attribute ‘bark’
an error that is not your fault might say something like:
Segmentation fault. <0xB129X7> memory block is unreadable.
+ 1
please share your code. This error likely has a number of possible causes. I personally have no experience in WhatsApp...
+ 1
thanks for your help @wilbur jaywright
+ 1
That is because in Android os there doesn't exist any os.environ['DISPLAY'] so all module which requires browser control and mouse/pixel movment control are not usable in Android
(Pywhatkit, pyAudio, pyautogui) wont work
0
import pywhatkit
pywhatkit.sendwhatmsg("+phone number" , "massage" , hour, min)
code is as above. I am learning python from my phone so please help me if there is any other library required to install. pywhatkit is already installed
0
error is as below 👇👇
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 2, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pywhatkit/__init__.py", line 4, in <module>
from pywhatkit.mainfunctions import sendwhatmsg_to_group, watch_tutorial_in_English, watch_tutorial_in_Hindi, developer_contact, showHistory, shutdown, cancelShutdown, prnt_sleeptm, check_window, sendwhatmsg, info, playonyt, image_to_ascii_art, search
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pywhatkit/mainfunctions.py", line 3, in <module>
import pyautogui as pg
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pyautogui/__init__.py", line 241, in <module>
import mouseinfo
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'DISPLAY'
[Program finished]
0
this looks like a failure within the API, though it’s still written in python at the point of failure. I’m not sure if you can fix it. However, someone else might know better than me here. I stopped programming in android a few years ago.
0
Bro I got same error
After 1 year
From you😅
If you find it solution
Please tell me.
0
Thanks