Warum wird beim Importieren eines Pyrogramms eine Fehlermeldung ausgegeben, dass keine aktuelle Ereignisschleife vorhandPython

Python-Programme
Anonymous
 Warum wird beim Importieren eines Pyrogramms eine Fehlermeldung ausgegeben, dass keine aktuelle Ereignisschleife vorhand

Post by Anonymous »

Wenn ich tp import pyrogram versuche, erhalte ich diese Fehlermeldung:

Code: Select all

Traceback (most recent call last):
File "c:\Users\User\Desktop\python\bots\SVG\bott copy.py", line 1, in 
from pyrogram import Client, filters, methods
File "c:\Users\User\AppData\Local\Programs\Python\Python314\Lib\site-packages\pyrogram\__init__.py", line 40, in 
from .sync import idle, compose
File "c:\Users\User\AppData\Local\Programs\Python\Python314\Lib\site-packages\pyrogram\sync.py", line 99, in 
wrap(Methods)
~~~~^^^^^^^^^
File "c:\Users\User\AppData\Local\Programs\Python\Python314\Lib\site-packages\pyrogram\sync.py", line 95, in wrap
async_to_sync(source, name)
~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "c:\Users\User\AppData\Local\Programs\Python\Python314\Lib\site-packages\pyrogram\sync.py", line 31, in async_to_sync
main_loop = asyncio.get_event_loop()
File "c:\Users\User\AppData\Local\Programs\Python\Python314\Lib\asyncio\events.py", line 715, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
und das ist buchstäblich mein ganzer Code:

Code: Select all

import pyrogram
Wenn ich versuche, Pyrogram zu aktualisieren, wird mir angezeigt, dass ich die neueste Version habe. Auch meine Python --version ist die neueste (3.14)
Hier ist mein Python -m pip freeze:

Code: Select all

PS C:\Users\User\Desktop\python> python -m pip freeze
bcrypt==4.3.0
beautifulsoup4==4.14.2
cachebox==5.0.4
certifi==2025.10.5
cffi==2.0.0
charset-normalizer==3.4.4
cryptography==38.0.4
idna==3.11
lxml==6.0.2
pyaes==1.6.1
pycparser==2.23
Pyrogram==2.0.106
pyrostep==2.11.22
PySocks==1.7.1
pyTelegramBotAPI==4.29.1
Ich habe Pyrogram folgendermaßen installiert:

Code: Select all

pip install pyrogram

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post