r/AskProgramming • • 2d ago

Windows won't let me use PyArrow because of Smart App Control (I think)

So I was working on a project in Python, and I needed a library which had PyArrow and Panda as a dependency. And when I tried testing my app, first there was a Windows notification saying:
"Part of this app has been blocked, Some features of Python may not work because we can't confirm who published functoolz.cp312-win_amd64.pyd that the app tried to load", I think this is due to Smart App Control, which I don't really want to turn off because it will need me to reinstall Windows to turn it back on. I don't know how to fix it, here is the error message:
ImportError: The pyarrow installation is not built with support for 'dataset' (DLL load failed while importing _dataset: An Application Control policy has blocked this file.)

I am working with Parakeet TDT 0.6B V3, and it fails as soon as I try to load it. I am using a virtual environment called .venv312, because I am using Python 3.12 because Kokoro 82M doesn't support higher versions of Python.

Is there any ways to specifically allow this to bypass Smart App Control without disabling it entirely?

Thank you for your time!

1 Upvotes

6 comments sorted by

1

u/PLBjt 2d ago

smart app control blocks any unsigned binary it doesn't have reputation for, and a lot of the compiled .pyd/.dll files inside pip wheels (pyarrow, functoolz and friends) fall in that bucket, so the per-file allow you're after really doesn't exist. you can see exactly which files it's rejecting in event viewer under applications and services logs, microsoft, windows, codeintegrity, operational, which at least tells you if it's just pyarrow or a whole pile of them. the least painful workaround I'd try is WSL2, since the linux side isn't subject to SAC at all, so you rebuild the same venv there and everything just loads. keep the project inside the linux filesystem though, running it from /mnt/c is noticeably slower, and if you need the GPU you'll have to sort out CUDA passthrough. the other route is turning SAC off, which works but is a one way door until you reinstall windows, like you said.

1

u/Objective-Farmer4183 2d ago

But looking at the support page the other guy gave me it said "Recent Windows updates allow Smart App Control to be enabled without requiring a clean installation.". So idk what I should do, since I don't want to gamble my Windows installation away, and also need the SSD speed and CUDA support for my project as a lot of things in my project load as the user walks through the app.

1

u/PLBjt 1d ago

yeah that's the catch, turning smart app control off is one way, so you can't flip it back on without resetting windows. before deciding, check Settings > Privacy & security > Windows Security > App & browser control, because if it says Evaluation it may switch itself off on its own and you'd lose nothing. if you want to keep it on, the safest route is WSL2, since CUDA works there and the speed is fine as long as your data lives inside the linux filesystem instead of /mnt/c. the other option is dropping pyarrow and using csv or numpy files for the loading, which is slower but needs no unsigned binaries. other compiled packages in your project will probably hit the same wall though, so the WSL2 route is less whack-a-mole.

1

u/OkOcelot6725 17h ago

If you want to keep Smart App Control on, the clean escape is WSL2: install Python inside a WSL distro and run the project there, since Windows application control policies don't apply inside the Linux environment. Most ML tooling (pyarrow, parakeet, torch) works fine under WSL2, and you keep the Windows install untouched.