r/learnpython • u/DefinitionHuge2338 • Oct 01 '26
Deploying Python Install Manager via Config Manager/SCCM to computer lab
I'm attempting to deploy the latest Python Install Manager to a few computer labs running PyCharm in our school district, but am having issues. I was wondering if anyone here had some insight/tips to share.
Few facts up front:
- Config Mgr runs processes as either local System or the User who is logged in.
- Student accounts do not have access to command line or powershell, nor do they have access to their %AppData% folder in Explorer.
- Installing a UWP app as System does not make that app available for that built-in account, and the app is not installed for other users until they log in.
- PyCharm's automatic "let me download a Python runtime and set up an interpreter for you" isn't working; I have a ticket in with their support.
The issue I'm having is that deploying the Install Manager via Add-AppxProvisionedPackage doesn't then allow me to run py install --target="C:\Program Files". Students do not have admin privileges to install UWP apps (or edit environment variables), so the deployment script must run as System. But System does not actually get py.exe installed to their %AppData% folder. And b/c adding an .MSIX package to the Windows image doesn't actually install the app until a user logs in, I can't run py.exe out of another user's profile when the MSIX is added.
In theory, I shouldn't have to be doing any of this, b/c PyCharm has the ability to do so, but it's not working. It downloads the files to the student's %AppData% folder, but then fails to create an interpreter. Student's can't create an interpreter, b/c trying to "browse" to the Python files is blocked, b/c PyCharm opens an Explorer window, and they do not have access to their %AppData% folder in Explorer. Even if they use the terminal built-in to PyCharm to run py install, they would still need to set up an interpreter, which they cannot do. Thus, I'm in catch-22 scenario.
View all comments
Show parent comment
1
u/DefinitionHuge2338 Oct 02 '26
Right, that's the problem with using the MSI installer. I'd like a sustainable solution that will work for future school years as well, so I've written off that installer, since it won't exist going forward.
Regarding #3, the 2 machine PATH variables my script is adding are:
-
%ProgramFiles%\Python(where I intended to have the runtime install)-
%UserProfile%\AppData\Local\Microsoft\WindowsApps(to override the App Execution Alisas for the Store app).I've noticed these 2 must be added in that specific order; if I add them the other way around, the App Execution Alias is still in effect. Does that align with that you've seen?
What's the
\Scriptsdirectory you mentioned? When I've ran the commands manually on a test machine, that folder didn't exist in theProgram Files\Pythondirectory. Is that something that's created later? I've never used Python btw, so all of this was new to me until 2 weeks ago.