python-dotenv
python-dotenv copied to clipboard
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.
Hi, thanks for reporting this issue. We've seen similar reports in the past but so far I don't think any of them has ever shown that Python-dotenv itself was the cause of the issue. Do you have any reason to believe this is something we can fix in Python-dotenv?
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.
Same issue here :(
Same
Consegui resolver com: sudo pip3 install python-dotenv
Consegui resolver com: sudo pip3 install python-dotenv
I'm on Windows 10, CMD runs as Admin didn't work
Same here. It's definitely installed in venv and even the system.
Same issue
Тщже самое
same here
For those who come to this topic, I figured out that I need to setup a virtual environment (It's a basic for Python, I'm a Nodejs-based so I don't know anything about virtual env). You can see the instruction here: https://docs.python.org/3/library/venv.html.
Then put all of your codebase into that new venv folder → activate the virtual env → install packages and it works.
Make sure to activate the virtual env every time you install package and run the code.