To answer this question I'm going to highlight a couple of points for you to consider.
- Until official support has been announced, don't use the non-official PowerShell PackageManagement provider for Chocolatey. It is an unsupported preview subject to bugs and security flaws (it was also not created by the Chocolatey team). Instead use choco.exe, or another official provider.
- AutoUninstaller is the resource in official Chocolatey clients that can remove natively installed software from packages that do not contain an uninstall script. It's important to note that you also need to install from those official clients. More information at https://chocolatey.org/docs/commands-uninstall
Why are these packages still present after uninstall-package?
It really depends on what you used to install the packages and whether Chocolatey was able to capture a snapshot for auto uninstaller.
Many packages do not require an uninstall script. Some do. When they are an MSI and are upgraded outside of Chocolatey (like Chrome does automatically), you either need Package Synchronizer or an uninstall script to uninstall the software.
Is there a best-practice way to do this?
If this is for organizational use, and you have a low tolerance for breakages, we recommend you build your own internal packages. Then you can completely control the process and have a repeatable, reliable process. This is how hundreds of organizations that use Chocolatey currently have enhanced their installation processes. They typically already have software installers already present on some internal file share and build packages around them to take advantage of better automation processes (versus old batch files they may have been using, or worse, manually installing from).
If you are curious on why you should build your own, see https://chocolatey.org/docs/community-packages-disclaimer (it attempts to highlight the issues with a public repository and it being subjected to distribution rights, something an internal repository is not subject to).
Is there a best-practice way to script python's re-installation so this won't happen again?
Use a configuration management tool like Puppet, Chef, Ansible, or DSC with the Chocolatey provider. https://chocolatey.org/docs/features-infrastructure-automation
This is how you create automation across all of your machines and take advantage of package management.
Answer from ferventcoder on Stack OverflowI'd like to either create a script to remove all versions of Python from a Windows machine or find one that has already been created. I need to remove Python from around 80 machines. Does anyone have any suggestions?
Need a programmatic method to uninstall python on Windows Server 2022.
Uninstallation command
Need a programmatic method to uninstall python on Windows Server 2022.
command - Powershell help for Python uninstall - Stack Overflow
Videos
You can check to see if there are such specific steps on the Python site. I removed the Python packages with Uninstall-Package and it worked as expected. Try repairing the installation using the Python installer, then run the Uninstall-Package cmdlet again.
Also it seems the packages should be removed in some specific order. I removed the documents and libraries first, and the core interpreter and executables last.
Hi,
What is the UninstallString? Have you checked the msi.log file for details?
See if you can uninstall the MSI using msiexec.exe
MsiExec.exe /x /quiet
Looking to remove python 3.12.3 from intune. I've tried everything under the sun so far but have not had no luck. Can someone correct me on where I am going wrong with this uninstall.
Below are a few of the commands that I have used for the uninstall command in intune
"AppData\Local\Package Cache\{5ee4d2b6-a5dc-4321-b6bd-3ebc98120a51}\python-3.12.3-amd64.exe" /uninstall
cmd /c "AppData\Local\Package Cache\{5ee4d2b6-a5dc-4321-b6bd-3ebc98120a51}\python-3.12.3-amd64.exe" /uninstall
I have used uninstall view to get the string for the application and have been experimenting with powershell and cmd locally to ensure that the commands work before i move them over to intune. As soon as they are run from intune they fail but run as intended via powershell / cmd.
Any helpful insight to get this working is appreciated.
Here's the steps (my non-computer-savvy girlfriend had to figure this one out for me, but unlike all the far more complicated processes one can find online, this one works)
- Open Control Panel
- Click "Uninstall a Program"
- Scroll down to Python and click uninstall for each version you don't want anymore.
This works on Windows 7 out of the box, no additional programs or scripts required.
You will also have to look in your system path. Python puts itself there and does not remove itself: http://www.computerhope.com/issues/ch000549.htm
Your problems probably started because your python path is pointing to the wrong one.