Automated Python Installation Script (macOS)
This project provides a Bash script to automatically install the latest version of Python on macOS using Homebrew.
It includes permission handling, temporary sudo access, and installation verification.
- Grants temporary sudo access to the logged-in user for installation.
- Ensures correct Homebrew installation path based on macOS architecture (Apple Silicon / Intel).
- Installs the latest Python version using Homebrew.
- Verifies installation by checking Python availability.
- Cleans up by removing temporary sudoers configuration.
- Clone the repository:
git clone https://github.com/<your-username>/python-macos-installer.git cd python-macos-installer
Make the script executable:
chmod +x python.sh
Run the script:
./python.sh
⚙️ Script Workflow
Detects macOS architecture (arm64 or x86_64).
Configures correct Homebrew path.
Grants temporary sudo privileges.
Installs the latest Python package via Homebrew.
Verifies installation with python3 --version.
Cleans up by removing sudoers entry.
🛠️ Requirements
macOS with Homebrew installed.
Internet connection.
bash, curl, and brew pre-installed.
📜 License
This project is licensed under the MIT License. You are free to modify and distribute it.