Azure / Azure/azure-sdk-tools

python virtual environment is not activated then result in python script can not be invoked successfully

Open
#13,636 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

When generating the Python SDK locally, I observed that the MCP tool's `verify_setup` function can create a virtual environment and install the required dependencies. However, the created virtual environment cannot be activated before invoking other MCP tools, which leads to errors indicating missing dependencies. For instance, when attempting to generate a changelog using the MCP tool, the output terminal displays the following error.

Image

```
2025-12-15 13:55:34.465 [warning] [server stderr] warn: Azure.Sdk.Tools.Cli.Services.Languages.LanguageService[0]
2025-12-15 13:55:34.465 [warning] [server stderr] Python script failed with exit code 1. Output: Traceback (most recent call last):
2025-12-15 13:55:34.465 [warning] [server stderr] File "/home/raychen/repos/github/azure-sdk-for-python/eng/scripts/get_package_properties.py", line 7, in
2025-12-15 13:55:34.465 [warning] [server stderr] from ci_tools.parsing import ParsedSetup
2025-12-15 13:55:34.466 [warning] [server stderr] ModuleNotFoundError: No module named 'ci_tools'
2025-12-15 13:55:34.466 [warning] [server stderr] warn: Azure.Sdk.Tools.Cli.Services.Languages.LanguageService[0]
2025-12-15 13:55:34.467 [warning] [server stderr] Could not determine package name for Python package at /home/raychen/repos/github/azure-sdk-for-python/sdk/elasticsan/azure-mgmt-elasticsan
```

If I activate the virtual environment manually and then run the script directly, the changelog is generated successfully.
```
/workspaces/azure-sdk-for-python (main) $ source .venv/bin/activate && pwsh scripts/automation_sdk_update_changelog_content.ps1 -PackagePath /workspaces/azure-sdk-for-python/sdk/computefleet/azure-mgmt-computefleet/
```

Image

Contributor guide

Open the contributing guide

Research direction

Start with the MCP tool's verify_setup function and the invocation path for Python scripts, using get_package_properties.py and scripts/automation_sdk_update_changelog_content.ps1 as the named entry points. Reproduce the missing ci_tools error, then verify that a generated virtual environment is used for subsequent MCP tool calls and that changelog generation succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.