{"course":{"slug":"python-for-ai","title":"Python, from Zero, for AI","url":"https://addaly.com/learn/python-for-ai","level":"beginner","track":"build"},"lesson":{"slug":"installing-python","title":"Getting Python onto the machine you actually have","url":"https://addaly.com/learn/python-for-ai/installing-python","position":1,"of":89,"minutes":9,"answer":"Choose a supported Python release. Follow the instructions for your operating system and check the exact interpreter command before adding packages.","keyIdea":"Choose a supported Python release. Follow the instructions for your operating system and check the exact interpreter command before adding packages."},"body":{"format":"markdown","text":"## There are three starting points, and all of them are free\n\nMost tutorials assume a laptop with an administrator password. Plenty of people reading this have a phone, or a shared computer they cannot install software on. All three cases work.\n\n**You already have a laptop or desktop.** Install from `python.org/downloads`. On Windows, the Python install manager provides the `python` and `py` commands. If you choose the traditional standalone installer, select **Add python.exe to PATH**. A missing `python` command can mean a command or PATH setup issue. Check the official Windows installation instructions before reinstalling.\n\nOn macOS, the installer gives you a command called `python3`. On Linux, Python is already there; `python3 --version` will tell you.\n\n**You have a phone.** On Android, install **Pydroid 3** from the Play Store: it ships a real Python with numpy and pandas already compiled, which matters, because compiling them yourself on a phone takes an hour. **Termux** (from F-Droid, not the Play Store version, which is abandoned) gives you a proper Linux shell and `pkg install python`. On iPhone, **a-Shell** is free and includes Python 3.\n\n**You have a browser and nothing else.** Go to `colab.research.google.com` and start a new notebook. You get a free machine with Python, numpy, pandas and most of what this course needs, already installed. Kaggle Notebooks are the same idea. The honest limitation: the machine is temporary. It disconnects after roughly 90 minutes of inactivity and at most 12 hours in a session, and when it goes, every file you created on it goes too. Download anything you want to keep, or connect it to Google Drive.\n\n## Check that it worked\n\nOpen a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS and Linux, the app itself on a phone) and type:\n\n```bash\npython3 --version\n```\n\nYou want something like `Python 3.12.4`. On Windows the command is usually just `python`.\n\n## The `python` versus `python3` split\n\nThis confuses everybody once. Python 2 and Python 3 are different languages with the same name. Python 2 was retired on 1 January 2020, but for twenty years `python` meant Python 2 on Unix systems, so macOS and most Linux distributions still refuse to let `python` mean Python 3 by default. Some now leave `python` pointing at nothing at all.\n\nThe rule that always works: type `python3` on macOS and Linux, `python` on Windows. If a tutorial says `python` and you get an error or a version starting with 2, add the 3.\n\nThe same split hits the installer: `pip` and `pip3`. Safer than both is `python3 -m pip`, which installs into *the same* Python you are running, and cannot get out of step. Module five goes into why that matters.\n\n## Which version to install\n\nChoose a supported stable release from python.org. Before installing a package, check which Python versions it supports. A precompiled wheel must match your Python version and platform. If one is unavailable, installation may need a source build and additional tools. Use a supported version with compatible wheels for the packages in your project.\n\nThe language examples require Python 3.10 or later. Choose a currently supported release, then check any additional package requirements when they are introduced.\n\n## An editor, and why not a word processor\n\nYou need something that writes plain text. Never Word, Pages or Google Docs: they insert curly quotation marks, and Python does not accept them.\n\n- **IDLE** ships with Python. It is plain, and it is already installed.\n- **Thonny** (`thonny.org`) is built for beginners: it shows variables changing as the program runs, which is useful for your first fortnight.\n- **VS Code** is free, is what most jobs use, and is heavier. Install the Python extension after it.\n- On a phone, Pydroid has its own editor.\n\nAny of these is fine. Do not spend an evening choosing.\n\n## Make a folder now\n\nCreate one folder for this course: `Documents/python` will do. Put every file you write inside it. When module five arrives with virtual environments, and lesson thirty-something with imports failing, half of those problems are \"which folder was I in\". Starting tidy costs nothing.\n\n> The setup is not the skill. If installation fights you for more than half an hour, open Colab in a browser and start learning. You can come back and install later, with more context and less frustration."},"check":{"question":"Somebody on macOS follows a tutorial that says `python myfile.py` and gets `command not found: python`, though they installed Python yesterday and the installer reported success. What is actually going on?","options":[{"text":"The installation silently failed, so it needs to be uninstalled and reinstalled before anything will run.","correct":false,"tempting":"Treats a missing command as a broken install, which is the intuitive reading when the only evidence is an error message."},{"text":"macOS blocks Python for security reasons unless it is opened once through System Settings.","correct":false,"tempting":"Borrows the real macOS quarantine prompt for downloaded apps and applies it to a command that was never blocked."},{"text":"The installer provides the command as `python3`; the bare name `python` is not guaranteed to point at anything on macOS.","correct":true},{"text":"The PATH checkbox was not ticked during installation, so the command cannot be found.","correct":false,"tempting":"Names a real cause of exactly this message, but that checkbox exists only in the Windows installer."}]},"prev":null,"next":{"slug":"first-line","title":"What a program is, and running your first line","url":"https://addaly.com/learn/python-for-ai/first-line"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Getting Python onto the machine you actually have', in Python, from Zero, for AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/python-for-ai/installing-python (Accessed: 21 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Getting Python onto the machine you actually have","courseTitle":"Python, from Zero, for AI","module":{"index":1,"slug":"getting-python-running","title":"Getting Python running, and your first working code"},"answer":null,"keyIdea":"Choose a supported Python release. Follow the instructions for your operating system and check the exact interpreter command before adding packages.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"there-are-three-starting-points-and-all-of-them-are-free","runs":[{"text":"There are three starting points, and all of them are free"}]},{"t":"p","runs":[{"text":"Most tutorials assume a laptop with an administrator password. Plenty of people reading this have a phone, or a shared computer they cannot install software on. All three cases work."}]},{"t":"p","runs":[{"text":"You already have a laptop or desktop.","b":true},{"text":" Install from "},{"text":"python.org/downloads","code":true},{"text":". On Windows, the Python install manager provides the "},{"text":"python","code":true},{"text":" and "},{"text":"py","code":true},{"text":" commands. If you choose the traditional standalone installer, select "},{"text":"Add python.exe to PATH","b":true},{"text":". A missing "},{"text":"python","code":true},{"text":" command can mean a command or PATH setup issue. Check the official Windows installation instructions before reinstalling."}]},{"t":"p","runs":[{"text":"On macOS, the installer gives you a command called "},{"text":"python3","code":true},{"text":". On Linux, Python is already there; "},{"text":"python3 --version","code":true},{"text":" will tell you."}]},{"t":"p","runs":[{"text":"You have a phone.","b":true},{"text":" On Android, install "},{"text":"Pydroid 3","b":true},{"text":" from the Play Store: it ships a real Python with numpy and pandas already compiled, which matters, because compiling them yourself on a phone takes an hour. "},{"text":"Termux","b":true},{"text":" (from F-Droid, not the Play Store version, which is abandoned) gives you a proper Linux shell and "},{"text":"pkg install python","code":true},{"text":". On iPhone, "},{"text":"a-Shell","b":true},{"text":" is free and includes Python 3."}]},{"t":"p","runs":[{"text":"You have a browser and nothing else.","b":true},{"text":" Go to "},{"text":"colab.research.google.com","code":true},{"text":" and start a new notebook. You get a free machine with Python, numpy, pandas and most of what this course needs, already installed. Kaggle Notebooks are the same idea. The honest limitation: the machine is temporary. It disconnects after roughly 90 minutes of inactivity and at most 12 hours in a session, and when it goes, every file you created on it goes too. Download anything you want to keep, or connect it to Google Drive."}]},{"t":"h2","id":"check-that-it-worked","runs":[{"text":"Check that it worked"}]},{"t":"p","runs":[{"text":"Open a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS and Linux, the app itself on a phone) and type:"}]},{"t":"code","lang":"bash","label":"Bash","text":"python3 --version"},{"t":"p","runs":[{"text":"You want something like "},{"text":"Python 3.12.4","code":true},{"text":". On Windows the command is usually just "},{"text":"python","code":true},{"text":"."}]},{"t":"h2","id":"the-python-versus-python3-split","runs":[{"text":"The "},{"text":"python","code":true},{"text":" versus "},{"text":"python3","code":true},{"text":" split"}]},{"t":"p","runs":[{"text":"This confuses everybody once. Python 2 and Python 3 are different languages with the same name. Python 2 was retired on 1 January 2020, but for twenty years "},{"text":"python","code":true},{"text":" meant Python 2 on Unix systems, so macOS and most Linux distributions still refuse to let "},{"text":"python","code":true},{"text":" mean Python 3 by default. Some now leave "},{"text":"python","code":true},{"text":" pointing at nothing at all."}]},{"t":"p","runs":[{"text":"The rule that always works: type "},{"text":"python3","code":true},{"text":" on macOS and Linux, "},{"text":"python","code":true},{"text":" on Windows. If a tutorial says "},{"text":"python","code":true},{"text":" and you get an error or a version starting with 2, add the 3."}]},{"t":"p","runs":[{"text":"The same split hits the installer: "},{"text":"pip","code":true},{"text":" and "},{"text":"pip3","code":true},{"text":". Safer than both is "},{"text":"python3 -m pip","code":true},{"text":", which installs into "},{"text":"the same","i":true},{"text":" Python you are running, and cannot get out of step. Module five goes into why that matters."}]},{"t":"h2","id":"which-version-to-install","runs":[{"text":"Which version to install"}]},{"t":"p","runs":[{"text":"Choose a supported stable release from python.org. Before installing a package, check which Python versions it supports. A precompiled wheel must match your Python version and platform. If one is unavailable, installation may need a source build and additional tools. Use a supported version with compatible wheels for the packages in your project."}]},{"t":"p","runs":[{"text":"The language examples require Python 3.10 or later. Choose a currently supported release, then check any additional package requirements when they are introduced."}]},{"t":"h2","id":"an-editor-and-why-not-a-word-processor","runs":[{"text":"An editor, and why not a word processor"}]},{"t":"p","runs":[{"text":"You need something that writes plain text. Never Word, Pages or Google Docs: they insert curly quotation marks, and Python does not accept them."}]},{"t":"ul","items":[[{"text":"IDLE","b":true},{"text":" ships with Python. It is plain, and it is already installed."}],[{"text":"Thonny","b":true},{"text":" ("},{"text":"thonny.org","code":true},{"text":") is built for beginners: it shows variables changing as the program runs, which is useful for your first fortnight."}],[{"text":"VS Code","b":true},{"text":" is free, is what most jobs use, and is heavier. Install the Python extension after it."}],[{"text":"On a phone, Pydroid has its own editor."}]]},{"t":"p","runs":[{"text":"Any of these is fine. Do not spend an evening choosing."}]},{"t":"h2","id":"make-a-folder-now","runs":[{"text":"Make a folder now"}]},{"t":"p","runs":[{"text":"Create one folder for this course: "},{"text":"Documents/python","code":true},{"text":" will do. Put every file you write inside it. When module five arrives with virtual environments, and lesson thirty-something with imports failing, half of those problems are “which folder was I in”. Starting tidy costs nothing."}]},{"t":"quote","runs":[{"text":"The setup is not the skill. If installation fights you for more than half an hour, open Colab in a browser and start learning. You can come back and install later, with more context and less frustration."}]}],"check":{"question":[{"text":"Somebody on macOS follows a tutorial that says "},{"text":"python myfile.py","code":true},{"text":" and gets "},{"text":"command not found: python","code":true},{"text":", though they installed Python yesterday and the installer reported success. What is actually going on?"}],"options":[{"text":[{"text":"The installation silently failed, so it needs to be uninstalled and reinstalled before anything will run."}],"correct":false,"tempting":[{"text":"Treats a missing command as a broken install, which is the intuitive reading when the only evidence is an error message."}]},{"text":[{"text":"macOS blocks Python for security reasons unless it is opened once through System Settings."}],"correct":false,"tempting":[{"text":"Borrows the real macOS quarantine prompt for downloaded apps and applies it to a command that was never blocked."}]},{"text":[{"text":"The installer provides the command as "},{"text":"python3","code":true},{"text":"; the bare name "},{"text":"python","code":true},{"text":" is not guaranteed to point at anything on macOS."}],"correct":true,"tempting":null},{"text":[{"text":"The PATH checkbox was not ticked during installation, so the command cannot be found."}],"correct":false,"tempting":[{"text":"Names a real cause of exactly this message, but that checkbox exists only in the Windows installer."}]}],"order":[1,0,2,3],"why":null},"prev":null,"next":{"slug":"first-line","title":"What a program is, and running your first line","minutes":6}}}