How to install Python 3
Links:
- Python homepage
- Python docs
How to install:
- Debian/Ubuntu (for other Linux distros, see this Gist).
- Install using apt-get.
$ sudo apt-get update $ sudo apt-get install python3 # OR python3.12 - Recommended - install development extensions (C headers necessary for some packages) and
pip(for installing packages globally).$ sudo apt-get install python3-dev python3-pip
- Install using apt-get.
- macOS
- Install Brew.
- Install Python using Brew:
$ brew install python@3 # OR python@3.12 - Make your the Brew executables
bindirectory is in yourPATHvariable.
- Windows
- Download Python from the Windows Download page.
- Run the installer. Make sure to check the box to have Python added to your
PATHif the installer offers such an option (it's normally off by default).
For managing multiple versions of Python, you can use pyenv to install and switch between versions.
For more details, see this Gist - Set up a Python 3 virtual environment.
namastaa thank you welcome