theskumar / theskumar/python-dotenv

[BUG] dotenv cli not used windows venv if it activated

Open
#373 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.9k
Forks
581
PR merge metrics
No merged PRs in 30d

Description

I use vscode on windows

Command:

python -m venv venv
.venv\Scripts\activate
pip install python-dotenv[cli]
dotenv run -- python -c "import sys; print(sys.executable)"

Expected:
\path\to\venv\Scripts\python.exe

Real:
\path\to\system\python.exe

If needed more info - I will try to provide it ASAP.

Cc: @scad89 help to find this issue

System:
Windows 10.

python -V
Python 3.8.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied command on Windows 10 with Python 3.8.5, comparing the executable reported inside the activated virtual environment with the one used by dotenv run. Trace how the CLI launches python; done means the command selects venv\Scripts\python.exe rather than the system interpreter.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.