theskumar / python-dotenv

Reads key-value pairs from a .env file and can set them as environment variables. It helps in developing applications following the 12-factor principles.
https://saurabh-kumar.com/python-dotenv/
BSD 3-Clause "New" or "Revised" License
7.55k stars 425 forks source link

dotenv module not found in python 3.11 version #488

Closed BhuwanPandey closed 11 months ago

BhuwanPandey commented 11 months ago

in main.py

from pathlib import Path from dotenv import load_dotenv

env_path = Path('.') / '.env' load_dotenv(dotenv_path=env_path)

Installed Packages python-dotenv 1.0.0

Operating System Ubuntu 22.04.2 LTS

Hy, there Firstly, I install python-dotenv on virualenviroment setup with python version 3.11.0 I tried various methods of installing and uninstalling by doing --> pip3 install python-dotenv --> python -m pip install python-dotenv --> pip3 install -U python-dotenv --> pip install -U python-dotenv

it's doesnot work then , i switch to python version 3.10.0 and it's then work

theskumar commented 11 months ago

@BhuwanPandey Feels like you probably installed python-dotenv while a different virtualenv was activated. Can you share the all the commands you ran to create and activate the virtualenv and the install this library. Also, version of python in that virtualenv. Thanks.

BhuwanPandey commented 11 months ago

I don't know how but its working now..