@@ -1033,9 +1033,12 @@ def publish_dotnet_app_to_payload(payload_dir_name: str, csproj_path: str, self_
10331033 RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--user" , "urllib3==1.26.19" ], verbose = True ).run ()
10341034 RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--user" , "requests" ], verbose = True ).run ()
10351035 else :
1036- RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--upgrade" , "pip" ], verbose = True ).run ()
1037- RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "urllib3==1.26.19" ], verbose = True ).run ()
1038- RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "requests" ], verbose = True ).run ()
1036+ # Externally-managed environment (PEP 668) - use --break-system-packages flag
1037+ # This is needed for Homebrew Python on macOS
1038+ getLogger ().info ("Using --break-system-packages flag for externally-managed environment" )
1039+ RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--break-system-packages" , "--upgrade" , "pip" ], verbose = True ).run ()
1040+ RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--break-system-packages" , "urllib3==1.26.19" ], verbose = True ).run ()
1041+ RunCommand ([* (agent_python .split (" " )), "-m" , "pip" , "install" , "--break-system-packages" , "requests" ], verbose = True ).run ()
10391042
10401043 scenarios_path = os .path .join (args .performance_repo_dir , "src" , "scenarios" )
10411044 script_path = os .path .join (args .performance_repo_dir , "scripts" )
0 commit comments