python-dotenv: bug: Getting "dotenv" could not be resolved error

  • Getting Import "dotenv" could not be resolved Pylance (reportMissingImports) again and again, although it is not affecting in development and running of the program, sometimes it can be annoying.

Screenshot from 2022-03-01 14-50-33

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

Hi there, i just faced the exact same issue as you, what helped me was to include # .env at the header of your .env file, i realized at least that VScode was able to recognize the dotenv namespace. And the import error should be gone.

  1. $ python -m venv venv

  2. $ source ./venv/Scripts/activate

  3. $ pip install python-dotenv

Consegui resolver com: sudo pip3 install python-dotenv