Cannot import name 'load_dotenv' from 'dotenv'

Viewed 13

I am running a python script in a virtual environment in which I have already installed all the requirements including dotenv (python-dotenv). I can see the dotenv package installed when I enter the following commands:

pip list

or

pip3 list

however, I am facing an issue while importing 'load_dotenv' from 'dotenv'.

I have tried almost all the common solutions such as:

  1. Uninstalling and re-installing the dotenv package
  2. Trying to use a different version of python to install dotenv

The Error I'm getting:

ImportError: cannot import name 'load_dotenv' from 'dotenv' (/Users/sankalpbhatia/Library/Python/3.9/lib/python/site-packages/dotenv/__init__.py)

Any help would be greatly appreciated!

0 Answers
Related