i am using dotenv in a flask project, and have also tested this in a dumbed down test environment as well. I have tried uninstalling and reinstalling etc but the dotenv module cannot be found by python.
When starting flask it sees there are some .env files and tells me to install dotenv even though it is installed and i can see it in flasks system libraries.
When I run code I get a module not found error saying it can't find dotenv. The code is
import os
from dotenv import load_dotenv
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
and the error is
Any advice gratefully accepted.
It's possible that you also have the "dotenv" package installed.
In your virtual environment, try:
pip uninstall dotenv
pip uninstall python-dotenv
pip install python-dotenv
Also you may have dotenv installed at the system level (outside of your virtual environment). If yes, you could try uninstalling that.
If this is not the issue then please post your code and the resultant error.