Python: Import command gets gray in Pycharm

Asked

Viewed 336 times

-1

I need help. I’m Newbie and I’m starting to study Python with the Guanabara videos on Youtube, to then invest in an Ead platform.

I installed Python 3 and Pycharm and the "import" command was working normally. Every time I try to import a library, for example import datetime, once I press Enter, the command is gray.

Did I disable something?inserir a descrição da imagem aqui

  • This happens on all lines?

  • 1

    No, just the first line. I also asked this question to a colleague and he told me that the import will be gray until I use one of the functions, then the import command will be colored again. Interesting that. Picking up and learning rssss... Thank you!

1 answer

0

In Pycharm, when the import is gray, it means it is not being used...

If you use it anyway, for example:

current_time = datetime.datetime.now()

it will turn colorful.

Pycharm offers some plugins to make your life easier... One of them is the Sonarlint, that shows some possible errors, as well as unused Imports.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.