r/AskProgramming • u/Alex-Recliner • 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?
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/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.12installs the python.org build (signed by the Python Software Foundation). Then:py -3.12 -m venv .venv.venv\Scripts\python -m pip install -r requirements.txt.venv\Scripts\pythonmain.pyinstead ofuv run.Some packages with unsigned DLLs can still get blocked; if so, test
importright after installing and try another version of that package.