问题
I wrote: import requests
- in my code without adding anything else, and this line is highlighted in gray.
PyCharm itself offered me to delete the line, but I need it.
Saw a way with adding:
#noinspection Py Unresolved References - but is it possible somehow without it?
screenshot of gray line
回答1:
If you aren't using any functions of the requests module PyCharm will show you a warning or error, because you load it in your memory and you don't need it, but if you are working with it later, you can just ignore it.
来源:https://stackoverflow.com/questions/64838032/unused-import-statement-import-requests-in-pychram