How To Do A Clean Install Of Python

Python programming requires the Python interpreter on your machine. Python applications are basically text files without the interpreter. Although Python is frequently out of date, it may be pre-installed on many operating systems, including macOS and Linux. Installing a more recent version specifically, Python 3 is necessary for the examples in certain books to function properly. Multiple Python versions can be installed on your computer at the same time
Python can be downloaded from the official website at www.python.org. Links to different versions and platforms can be found on the downloads page.
The Python distribution and the auxiliary applications pip and virtualenv are usually downloaded as part of a normal installation from python.org. The Python interpreter, documentation, command-line access, IDLE (Integrated Development Environment) application, Preferred Installer Program (pip), and occasionally an uninstaller are all typically included in the downloaded file.
Python’s integrated development and learning environment, or IDLE, is a built-in tool that functions similarly to a word processor for programs and has both script and interactive modes.
Installing and managing third-party packages from the Python Package Index (PyPI) is done with Pip, Python’s package manager.
An overview of installation techniques according to your operating system is provided here:
Windows
- Python is usually not pre-installed on Windows systems.
- The official Python website (python.org) offers the relevant executable installer (.msi or.exe file) for download.
- Launch the installation. Like other apps, the installation process frequently adheres to a common protocol.
- When installing, it is advised to choose the “Add Python to PATH” option. This facilitates accurate system configuration.
- You have the option to select features and alter the installation. For certain publications, it is advised to retain all features chosen.
- Choosing “Install for All Users” guarantees that Python is available to all users. You should keep “Precompile Standard Library,” which is what this option automatically chooses.
- Select a different target folder as the default Windows \Program Files or \Program Files (x86) folders may require administrator permission and be difficult to access from within the application due to spaces in the name.
- An example installation folder is C:\Python36. Later, you can save time by using the default destination.
You can check it after installation by entering “python” into a terminal or Command Prompt. The Python prompt (>>>) ought to appear.
Additionally, a Windows installation adds a folder with IDLE and the Python command line to the Start menu.
macOS
- Python is probably preinstalled on Mac OS X users, however it might be an earlier version. Installing the most recent version is advised if it is version 2.7 or lower.
- The.dmg file can be downloaded from the Python.org website.
- To launch the installer, double-click the downloaded file.
- Observe the installer’s instructions. You may need to click through the welcome and licence sections for certain installs. It may be necessary for you to input the administrator password.
- If you’re using Anaconda, the installer might install everything to a “anaconda” directory under your home directory.
Linux
- Additionally, Python possibly an older version is probably preinstalled on Linux users.
- The typical Linux installation process, which entails working at the Terminal and entering commands, can be used to install Python. Linux versions may differ in specific commands. You can run sudo apt-get install python3 for Ubuntu.
- It may be necessary to add a Personal Package Archive (PPA) such as “deadsnakes” to earlier Ubuntu versions (17 and below) in order to obtain more recent versions.
- It might be necessary to compile the provided external code using this way.
- Some Debian-based Linux versions, such Ubuntu 12.x and later, offer graphical installation.
The Python 3.6 subdirectory may be in your personal folder after installation, but it’s generally at /usr/local/bin/Python3.6. For certain versions, Linux developers may need to type Python3.6 in the Terminal rather than Python.
By using python3 version in the Terminal, you may confirm the installation.
Online Environments
With tools like Replit, CodeAcademy, or Codevny, you can build and run Python programs online if you have internet connection.
Using an online simulator that includes a Python interpreter, like Trinket at https://trinket.io, is a simple method of running Python without having to install anything on your PC.
Anaconda Distribution
- An all-in-one distribution, Anaconda prioritises data science and science.
- Along with numerous well-known data science libraries, such as beautifulsoup4, flask, ipython, matplotlib, nose, numpy, pandas, pillow, pip, scipy, tables, and zmq, it comes with Python and its standard library. The conda package manager is also included.
- An easiest way to get started with Python is to install Anaconda.
- Because Anaconda installs everything in a separate location, it won’t conflict with other versions of Python. Installing it typically doesn’t require any specific rights.
- Download Python 3 from the Anaconda website to install.
- Choose the Windows, macOS, or Linux link. For Python 3, name the file Anaconda3.
- Launch the installation that was downloaded.
- Double-click the.exe file on Windows. The installer for macOS will be installed in your home directory’s anaconda directory. Run the shell script on Linux.
- On Linux, you may be prompted to include the installation path in your PATH declaration.
Certain books specifically test programs against Python installed via python.org and warn that installing Python via Anaconda may cause issues.
You can write and execute your first programs after installing Python, usually beginning with a straightforward “Hello, World!” application. Python programs can be executed by executing a Python file or by utilising the interactive interpreter. Usually, you can use an IDE like IDLE or the terminal/command line to access Python on your computer.