r/AskProgramming • • 11d ago

Windows Defender / Smart App Control blocking local Python executable in VS Code.

Running uv run main.py in my VS Code terminal fails to execute.

Some features of python may not work because we can't confirm who published python.exe that the app tried to load.

Added the developer folder (D:\play-store-review-scrapper) to the Windows Security Folder Exclusions list.

Cannot whitelist the app in "Reputation-based protection" because the options are greyed out with the message:

This setting is managed by Smart App Control

How do I allow my .venv Python executable to run when Smart App Control completely locks the reputation-based settings?

4 Upvotes

4 comments sorted by

2

u/Lumpy-Notice8945 11d ago

Disable "smart app controll"? I dont even realy know what that is but it sounds like a new microslop feature.

But its the same for windows defender, if it marks a false positive and refuses to accept an exception, you just deactivate it...

Assuming you are surr its the correct python.exe and not some malware...

1

u/Alex-Recliner 11d ago

Thanks!! code started executing after turning off smart app control

1

u/Valtersjbh 4d ago

Had exactly this. Smart App Control blocks the Python builds that uv downloads (python-build-standalone) because they aren't signed by a known publisher, and you can't whitelist anything while SAC is on.

What worked without turning SAC off: create the venv with the official signed Python instead of uv's. On Windows, winget install Python.Python.3.12 installs the python.org build (signed by the Python Software Foundation). Then:

  1. py -3.12 -m venv .venv
  2. .venv\Scripts\python -m pip install -r requirements.txt
  3. Run with .venv\Scripts\python main.py instead of uv run.

Some packages with unsigned DLLs can still get blocked; if so, test import right after installing and try another version of that package.