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 [email protected]
- Make your the Brew executables
bin
directory is in yourPATH
variable.
- Windows
- Download Python from the Windows Download page.
- Run the installer. Make sure to check the box to have Python added to your
PATH
if 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