Forums

I have a some error, when i run telegram bot

Hello, everybody. Recently i installed some python-libraries, here is list of libraries: 1. Telebot 2. TelebotAPI 3. PyautoGUI 4. Ctypes

But, when i installed Ctypes, console began show these error:

Traceback (most recent call last): File "/home/Vdmitriy2973/2.py", line 6, in <module> import pyautogui File "/home/Vdmitriy2973/.local/lib/python3.8/site-packages/pyautogui/init.py", line 241, in <module> import mouseinfo File "/home/Vdmitriy2973/.local/lib/python3.8/site-packages/mouseinfo/init.py", line 223, in <module> _display = Display(os.environ['DISPLAY']) File "/usr/lib/python3.8/os.py", line 673, in getitem raise KeyError(key) from None KeyError: 'DISPLAY'

Anyone know, how i can Fix these errors? Thanks in advance :)

Pyautogui would not work on PythonAnywhere, as there is no display connected to our servers.

Can you send me list, where are the libraries that work on this hosting?

There is no full list because new libraries are created for Python every day. In general, though, if something uses a graphical user interface then it will not work; if it does not, then it normally will.

which library to use instead of pyautogui ?

It depends on what you're trying to do -- important thing is to remember that PythonAnywhere is a headless environment, so it's not designed to develop GUI applications.