Python Programming/Getting Python
To program in Python, you need a Python interpreter to run your code—we will discuss interpreters later. If it's not already installed, or if the version you are using is obsolete, you will need to obtain and install Python using the methods below. The current Python versions are 3.x; versions 2.x are discontinued and no longer maintained.
Installing Python on Windows
[edit | edit source ]Visit Python Download Page & download the latest stable version of python (3.13.7 as of October 2025) installer, & follow through the installation guide by running the .exe installer.
Installing Python on Mac OS
[edit | edit source ]Users on older versions of Mac OS (Mojave 10.14 & prior) will have Python installed by default; however, it may not be on the latest version. Please visit Python Download Page, follow the instructions on the page and in the installers. As a bonus you will also install the Python IDE. However, on more recent versions of Mac OS (Catalina 10.15 & on), Python will not be installed by default.
Installing Python on Linux[1]
[edit | edit source ]Python is available as a package for most Linux distributions. However, other distributions require downloading the source code and using the compilation scripts.
Installation Check List
[edit | edit source ]- Root Access: Sudo privileges to install software.
- Terminal Access: Familiarity with the command line.
- Internet Connection: Active internet access to download packages.
- Disk Space: At least 200MB available.
- Command-Line Basics: Understanding of simple terminal commands.
Check if pre-installed
[edit | edit source ]Some Linux distributions may come with Python pre-installed, but it’s essential to note that it might be outdated & needs to be updated to the latest version. To check, run either
python3 --version
or
python --version
If Python is installed, the terminal will display its version number. If not, the terminal will return a "command not found" error, indicating that Python needs to be installed.
Installing Python For Ubuntu/Debian Based Systems using APT
[edit | edit source ]APT (Advanced Package Tool) is the default package manager for Ubuntu and Debian-based systems, known for its Extensive package repository, Strong security features, Stable package versions, and Regular security updates. To install python using APT, please run the following commands in the terminal:
sudo apt update
sudo apt upgrade
sudo apt install python3
The python package manager is essential to manage python libraries & dependencies, but not required:
sudo apt install python3-pip
to verify the installation, please run the following command:
python3 --version
If Python was installed correctly, the terminal will display its version number. If not, the terminal will return a "command not found" error, indicating that Python was not installed correctly.
Source code installations
[edit | edit source ]Some platforms do not have a version of Python installed, and do not have pre-compiled binaries. In these cases, you will need to download the source code from the official site. Once the download is complete, you will need to unpack the compressed archive into a folder.
To build Python, simply run the configure script (requires the Bash shell) and compile using make.
Other Distributions
[edit | edit source ]Python, also referred to as CPython to avoid confusion, is written in the C programming language, and is the official reference implementation. CPython can run on various platforms due to its portability.
Apart from CPython there are also other implementations that run on top of a virtual machine. For example, on Java's JRE (Java Runtime Environment) or Microsoft's .NET CLR (Common Language Runtime). Both can access and use the libraries available on their platform. Specifically, they make use of reflection that allows complete inspection and use of all classes and objects for their very technology.
Python Implementations (Platforms)
Environment | Description | Get From |
---|---|---|
Jython | Java Version of Python | Jython |
IronPython | C# Version of Python | IronPython |
Integrated Development Environments (IDE)
[edit | edit source ]It's common to use a simple text editor for writing Python code, but you may feel the need to upgrade to a more advanced IDE. CPython ships with IDLE; however, IDLE is not considered user-friendly.[2] For Linux, KDevelop and Spyder are popular. For Windows, PyScripter is free, quick to install, and comes included with PortablePython.
Some Integrated Development Environments (IDEs) for Python
Environment | Description | Get From |
---|---|---|
ActivePython | Highly flexible, Pythonwin IDE | ActivePython |
Anjuta | IDE Linux/Unix | Anjuta |
Eclipse (PyDev plugin) | Open-source IDE | Eclipse |
Eric | Open-source Linux/Windows IDE. | Eric |
KDevelop | Cross-language IDE for KDE | KDevelop |
Ninja-IDE | Cross-platform open-source IDE. | Nina-IDE |
PyScripter | Free Windows IDE (portable) | PyScripter |
Pythonwin | Windows-oriented environment | Pythonwin |
Spyder | Free cross-platform IDE (math-oriented) | Spyder |
VisualWx | Free GUI Builder | VisualWx |
The Python official wiki has a complete list of IDEs.
There are several commercial IDEs such as Komodo, BlackAdder, Code Crusader, Code Forge, and PyCharm. However, for beginners learning to program, purchasing a commercial IDE is unnecessary.
Trying Python online
[edit | edit source ]You can try Python online, thereby avoiding the need to install. The online Python shell at Python's official site provides a web Python REPL (read–eval–print loop).
Keeping Up to Date
[edit | edit source ]Python has a very active community and the language itself is evolving continuously. Make sure to check python.org for recent releases and relevant tools. The website is an invaluable asset.
Public Python-related mailing lists are hosted at mail.python.org. Two examples of such mailing lists are the Python-announce-list to keep up with newly released third party-modules or software for Python and the general discussion list Python-list. These lists are mirrored to the Usenet newsgroups comp.lang.python.announce & comp.lang.python.
Notes
[edit | edit source ]- ↑ "How to Install Python on Linux". GeeksforGeeks. 2020年01月14日. Retrieved 2025年10月07日.
- ↑ The Things I Hate About IDLE That I Wish Someone Would Fix .