You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F5 debugging ignores newly created .venv and fails to load openai #5182
OS: Win 11 x64 Build Version: 20260910.1 Regression: Not a Regression
Repro Steps:
Create a project using the LangChain with OpenAI (Python + AZD + Bicep) template from Azure Functions Template Gallery.
After project creation, Azure Functions shows: Failed to find Python virtual environment ".venv".
Click "Create virtual environment".
Wait for dependency installation to complete.
Press F5 to start debugging.
Expect:
F5 debugging should use the virtual environment created from the Azure Functions notification and successfully resolve dependencies installed in .venv.
Actual:
Debugging fails with error ModuleNotFoundError: No module named 'openai'.
Although the virtual environment is created and dependency installation reports completion, the debugger appears not to use the newly created .venv, causing required packages to be unavailable at runtime.
* Executing task: .venv\Scripts\python -m pip install -r requirements.txt
Requirement already satisfied: openai in
C:\Users\v-ruizh\Desktop\99\pylangchain\.venv\Lib\site-packages
...
[Error]
ModuleNotFoundError: No module named 'openai'
Additional observation:
Current sys.path contains:
C:\Users\v-ruizh\AppData\Local\Programs\Python\Python312\Lib\site-packages
but does not contain:
C:\Users\v-ruizh\Desktop\99\pylangchain\.venv\Lib\site-packages
More Info:
The issue was transient. After re-running the dependency installation command and retrying debugging later, the project started successfully without further changes. However, the initial F5 session consistently failed with ModuleNotFoundError: No module named 'openai'.
I can reproduce a very similar issue with the Durable Functions Order Processing template.
The project is created successfully and the generated .venv is present under the project folder.
F5 debugging fails with: ModuleNotFoundError: No module named 'azure.durable_functions'
However, the package is available in the generated virtual environment:
..venv\Scripts\python.exe -c "import azure.durable_functions as df"
This command succeeds without error.
The project also runs successfully when started manually: func start
All functions are discovered and indexed correctly.
This suggests the dependency itself is installed correctly and the issue only occurs during F5 debugging. It looks very similar to the behavior described in this issue, where the debugger may not be using the generated .venv.
The LangChain sample repository is archived and is removed from Template Gallery. This applies to the archived LangChain sample; the Durable Functions Order Processing reproduction reported above remains unresolved.
Activity
v-ruizh commentedon Sep 21, 2026
I can reproduce a very similar issue with the Durable Functions Order Processing template.
The project is created successfully and the generated .venv is present under the project folder.
F5 debugging fails with: ModuleNotFoundError: No module named 'azure.durable_functions'
However, the package is available in the generated virtual environment:
..venv\Scripts\python.exe -c "import azure.durable_functions as df"
This command succeeds without error.
The project also runs successfully when started manually: func start
All functions are discovered and indexed correctly.
This suggests the dependency itself is installed correctly and the issue only occurs during F5 debugging. It looks very similar to the behavior described in this issue, where the debugger may not be using the generated .venv.
manvkaur commentedon Oct 1, 2026
The LangChain sample repository is archived and is removed from Template Gallery. This applies to the archived LangChain sample; the Durable Functions Order Processing reproduction reported above remains unresolved.