Python is an interpreted, high-level and general-purpose programming language. Python’s design philosophy emphasizes code readability with its notable use of significant whitespace. This article will serve as an informative guide and give you a clear understanding of how to perform a silent installation of Python 3.9 from the command line using the EXE installer.
How to Install Python 3.9 Silently
Python 3.9 (32-bit) Silent Install (EXE)
- Navigate to: https://www.python.org/ftp/python/
- Select the 3.9.x version of your choice
- Download the python-3.9.x.exe to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command:
- python-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1
- Press Enter
After a few moments you will find Python entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | Python 3.9 (32-bit) |
Vendor: | Python Software Foundation |
Architecture: | x86 |
Installer Type: | EXE |
Silent Install Switch: |
|
Silent Uninstall Switch: | python-3.9.x.exe /uninstall /quiet |
Repair Command: |
|
Download Link: | https://www.python.org/ftp/python/ |
PowerShell Script: | https://silentinstallhq.com/python-3-9-install-and-uninstall-powershell/ |
Detection Script: | https://silentinstallhq.com/create-a-custom-detection-script-for-python-powershell/ |
Python 3.9 (64-bit) Silent Install (EXE)
- Navigate to: https://www.python.org/ftp/python/
- Select the 3.9.x version of your choice
- Download the python-3.9.x-amd64.exe to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command:
- python-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1
- Press Enter
After a few moments you will find Python entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | Python 3.9 (64-bit) |
Vendor: | Python Software Foundation |
Architecture: | x64 |
Installer Type: | EXE |
Silent Install Switch: | python-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 |
Silent Uninstall Switch: |
|
Repair Command: |
|
Download Link: | https://www.python.org/ftp/python/ |
PowerShell Script: | https://silentinstallhq.com/python-3-9-install-and-uninstall-powershell/ |
Detection Script: | https://silentinstallhq.com/create-a-custom-detection-script-for-python-powershell/ |
The information above provides a quick overview of the software title, vendor, silent install, and silent uninstall switches. The download links provided take you directly to the vendors website. Continue reading if you are interested in additional details and configurations.
Additional Configurations
Create an Installation Log File
The Python 3.9 installer offers the option to generate a log file during installation to assist with troubleshooting should any problems arise. You can use the following command to create a verbose log file with details about the installation.
Python 3.9 (32-bit) Silent Install with Loggingpython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 /log "%WINDIR%\Temp\Python39-Install.log"
Python 3.9 (64-bit) Silent Install with Loggingpython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 /log "%WINDIR%\Temp\Python39-Install.log"
Change Default Installation Directory
You can change the default installation directory by using the following command line parameters. In this example, I’m installing Python 3.9 to “C:\Python39”
Python 3.9 32-bit (EXE)python-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 TargetDir="C:\Python39"
Python 3.9 64-bit (EXE)python-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 TargetDir="C:\Python39"
Exclude Python Documentation
Python 3.9 (32-bit) Silent Install (EXE) Excluding Documentationpython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_doc=0
Python 3.9 (64-bit) Silent Install (EXE) Excluding Documentationpython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_doc=0
Exclude Pip (Tool for Installing and Managing Python Packages)
Python 3.9 (32-bit) Silent Install (EXE) Excluding Pippython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_pip=0
Python 3.9 (64-bit) Silent Install (EXE) Excluding Pippython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_pip=0
Exclude Tkinter and IDLE Development Environment
Python 3.9 (32-bit) Silent Install (EXE) Excluding Tkinter and IDLE
python-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_tcltk=0 |
Python 3.9 (64-bit) Silent Install (EXE) Excluding Tkinter and IDLE
x |
Exclude Python Standard Library Test Suite
Python 3.9 (32-bit) Silent Install (EXE) Excluding Test Suitepython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
Python 3.9 (64-bit) Silent Install (EXE) Excluding Test Suitepython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
Exclude Python Launcher for Windows
Python 3.9 (32-bit) Silent Install (EXE) Excluding Python Launcherpython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_launcher=0
Python 3.9 (64-bit) Silent Install (EXE) Excluding Python Launcher
xpython-3.9.
-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_launcher=0
Associate Files with Python
Python 3.9 (32-bit) Silent Install (EXE) with File Associationpython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 AssociateFiles=1
Python 3.9 (64-bit) Silent Install (EXE) with File Associationpython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 AssociateFiles=1
Exclude Shortcuts for Interpreter, Documentation and IDLE
Python 3.9 (32-bit) Silent Install (EXE) Excluding Shortcuts
python-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Shortcuts=0 |
Python 3.9 (64-bit) Silent Install (EXE) Excluding Shortcutspython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Shortcuts=0
Exclude Python from PATH Environment Variable
Python 3.9 (32-bit) Silent Install (EXE) Exclude PATH Env Variable
python-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=0 |
Python 3.9 (64-bit) Silent Install (EXE) Exclude PATH Env Variable
|
Compile all .py files to .pyc
Python 3.9 (32-bit) Silent Install (EXE) with Compiled Filespython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 CompileAll=1
Python 3.9 (64-bit) Silent Install (EXE) with Compiled Filespython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 CompileAll=1
Include Python Debugging Symbols
Python 3.9 (32-bit) Silent Install (EXE) with Debugging Symbolspython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_symbols=1
Python 3.9 (64-bit) Silent Install (EXE) with Debugging Symbolspython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_symbols=1
Include Python Debug Binaries
Python 3.9 (32-bit) Silent Install (EXE) with Debug Binariespython-3.9.x.exe /quiet InstallAllUsers=1 PrependPath=1 Include_debug=1
Python 3.9 (64-bit) Silent Install (EXE) with Debug Binariespython-3.9.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_debug=1
Configure Python Settings with Unattend.xml
- Open Notepad or your favorite text editor
- Add the following lines and set values based on your preferences:
<Options>
<Option Name="InstallAllUsers" Value="1" />
<Option Name="TargetDir" Value="C:\Python39" />
<Option Name="DefaultAllUsersTargetDir" Value="C:\Python39" />
<Option Name="DefaultJustForMeTargetDir" Value="C:\Python39" />
<Option Name="DefaultCustomTargetDir" Value="C:\Python39" />
<Option Name="AssociateFiles" Value="1" />
<Option Name="CompileAll" Value="1" />
<Option Name="PrependPath" Value="1" />
<Option Name="Shortcuts" Value="1" />
<Option Name="Include_doc" Value="1" />
<Option Name="Include_debug" Value="1" />
<Option Name="Include_dev" Value="1" />
<Option Name="Include_exe" Value="1" />
<Option Name="Include_launcher" Value="1" />
<Option Name="InstallLauncherAllUsers" Value="1" />
<Option Name="Include_lib" Value="1" />
<Option Name="Include_pip" Value="1" />
<Option Name="Include_symbols" Value="1" />
<Option Name="Include_tcltk" Value="1" />
<Option Name="Include_test" Value="1" />
<Option Name="Include_tools" Value="1" />
<Option Name="LauncherOnly" Value="0" />
<Option Name="SimpleInstall" Value="0" />
<Option Name="SimpleInstallDescription"></Option>
</Options>
- Save the file to C:\Downloads and name it: unattend.xml
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command:
- python-3.9.x-amd64.exe /quiet .\unattend.xml
- Press Enter
How to Uninstall Python 3.9 Silently
Check out the following posts for a scripted solution:
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Enter one of the following sets of commands:
Python 3.9 (32-bit) Silent Uninstall (EXE)python-3.9.x.exe /uninstall /quiet
MsiExec.exe /x {E45E56A4-FCDD-4C4A-966A-4FB81C932219} /qn
Python 3.9 (64-bit) Silent Uninstall (EXE)python-3.9.x-amd64.exe /uninstall /quiet
MsiExec.exe /x {E45E56A4-FCDD-4C4A-966A-4FB81C932219} /qn
Always make sure to test everything in a development environment prior to implementing anything into production. The information in this article is provided “As Is” without warranty of any kind.