VS Code показывает «случайное» переопределение модуля, как это решить?Python

Программы на Python
Гость
VS Code показывает «случайное» переопределение модуля, как это решить?

Сообщение Гость »


Проверьте это проблемное изображение. Я импортировал module in Python and tried running it. It is imported and it is running good as well, but VSCode is giving a yellow line warning and showing that it is overriding with the module in

Код: Выделить всё

venv\Lib
. It is asking me to change the name of

Код: Выделить всё

random.py
to something else, which I can't change because it will give me errors in other libraries like pandas, numpy, matplotlib, and OpenCV. How can I remove this unwanted warning?
This is the error I'm getting:

Код: Выделить всё

"c:\Users\Syed M Tayyab\Desktop\VS Code ML\venv\Lib\random.py" is overriding the stdlib module "random"PylancereportShadowedImports
I tried changing random.py To something else but as I mentioned earlier that changing randon.py to something else may solve this problem but will generate more problems in other libraries as random.py is also imported in them.


Источник: https://stackoverflow.com/questions/763 ... o-solve-it

Вернуться в «Python»