I am using pyrogram in a program but when i run the program it gives import error i uninstalled and reinstalled it but the problem is still there. I am not able to fix it i have tried the previous version as well as the new version but the problem is the same. Here is the output:
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrogram
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/__init__.py", line 40, in <module>
from . import raw, types, filters, handlers, emoji
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/__init__.py", line 22, in <module>
from .input_media import *
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/input_media/__init__.py", line 25, in <module>
from .input_phone_contact import InputPhoneContact
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/input_media/input_phone_contact.py", line 20, in <module>
from pyrogram.session.internals import MsgId
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/session/__init__.py", line 19, in <module>
from .auth import Auth
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/session/auth.py", line 29, in <module>
from pyrogram.crypto import aes, rsa, prime
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/crypto/prime.py", line 19, in <module>
from random import randint
File "/home/ak/Desktop/development/bots/pyrogramplugins/multiuserbot/final/random.py", line 1, in <module>
from pyrogram import Client, filters, idle
File "/home/ak/.local/lib/python3.9/site-packages/pyrogram/filters.py", line 24, in <module>
from pyrogram.types import Message, CallbackQuery, InlineQuery, InlineKeyboardMarkup, ReplyKeyboardMarkup, Update
ImportError: cannot import name 'Message' from partially initialized module 'pyrogram.types' (most likely due to a circular import) (/home/ak/.local/lib/python3.9/site-packages/pyrogram/types/__init__.py)
>>>
I am stuck here i have tried everything i know but not able to fix it
It is because the file name is same as the module name which I am using in code. Change the file name and never give file a name which is the name of a module