Updating Python on systems like Raspberry Pi and Ubuntu can be a daunting task, filled with dependency conflicts and compatibility issues. This script simplifies the process, enabling you to install or update any Python version easily with just one command. Itβs perfect for developers, hobbyists, and system administrators.
π‘ Why this script?
- No more manual dependency hunting or installation errors.
- Works seamlessly for both Raspberry Pi OS and Ubuntu.
- Ideal for keeping your system's Python version up-to-date.
Warning: Updating Python can affect your current system setup. Please ensure youβve read the details below and have a proper backup before proceeding.
- π₯ Installation
β οΈ Important Notes- π§ How It Works
- π Features
- π Version History
- π» Contributions
- β Support My Work
- π Contact
- π License
Run the script directly from GitHub:
wget -qO - https://raw.githubusercontent.com/tvdsluijs/sh-python-installer/main/python.sh | sudo bash -s [python_version]
Replace [python_version]
with your desired version. For example:
- To install Python 3.9.6:
wget -qO - https://raw.githubusercontent.com/tvdsluijs/sh-python-installer/main/python.sh | sudo bash -s 3.9.6
- To install Python 3.10.0:
wget -qO - https://raw.githubusercontent.com/tvdsluijs/sh-python-installer/main/python.sh | sudo bash -s 3.10.0
- To install Python 3.11 Alpha:
wget -qO - https://raw.githubusercontent.com/tvdsluijs/sh-python-installer/main/python.sh | sudo bash -s 3.11.0a1
π For a list of all available Python versions, visit the official Python Versions page.
-
System Updates: This script will update your system before installing Python. Be aware that these updates might introduce issues or conflicts with your current setup.
- Recommendation: Ensure you have a full backup of your system before running this script.
-
Warranty Disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
Use this script at your own risk. The author is not responsible for any issues or damages caused to your system.
-
Verbose Mode (
-v
):- Add the
-v
flag to enable verbose mode for detailed logging. Example:wget -qO - https://raw.githubusercontent.com/tvdsluijs/sh-python-installer/main/python.sh | sudo bash -s 3.10.0 -v
- Logs will also be saved in a file named
python_install_<version>.log
.
- Add the
- Checks System Requirements: Ensures sufficient disk space and root privileges.
- Validates Python Version: Confirms the requested Python version is available for download.
- System Update: Updates your OS to avoid dependency issues.
- Builds and Installs Python: Compiles the source code with optimizations.
- Fallback Safety: Doesnβt overwrite the default system Python (
altinstall
is used).
- Ease of Use: Install Python with a single command.
- Customizable: Supports any 3.x.x Python version.
- Verbose Logging: Debug issues easily with detailed logs (
-v
flag). - Compatibility: Works on both Raspberry Pi OS and Ubuntu.
Version | Date | Changes |
---|---|---|
1.2.0 | 29 Nov 2024 | Improved README, added verbose mode, Python version validation, and more robust error checks. |
1.1.1 | 16 Oct 2022 | Improvements by Matthias Frank. |
1.1.0 | 29 Jun 2022 | Docker support added. Thanks to suggestions by TonyLHansen. |
1.0.2 | 20 Apr 2022 | Minor updates by Stephen-mw. |
1.0.0 | 26 Sep 2021 | First release. |
- Acknowledgments: Thanks to TonyLHansen, Henry, Matthias Frank, and others for contributions and feedback.
- Want to contribute? Fork the repo, submit pull requests, or open issues on GitHub.
If this script saved you time or made your life easier, consider supporting it:
- β Star this repo: GitHub Repo
- β Donate a coffee:
- Share: Tell others about this tool!
Your support helps keep this project alive and growing. Thank you! π
- Website: itheo.tech
- Resume: Theovandersluijs.eu
- Contact Form: itheo.tech/contact
This project is licensed under the MIT License.