PDF download Download Article PDF download Download Article

Python is an interpreted, object-oriented, high-level programming language that is a great place for beginners to start learning how to program. Python comes installed on Macs and with Linux, but you'll need to install it yourself if you're using Windows. If you're using a Mac or a Linux computer, you can install the latest version to ensure you have access to the latest features.

Method 1
Method 1 of 3:

Windows

PDF download Download Article
  1. You can download everything you need to get started with Python from the Python website (python.org/downloads. The website should automatically detect that you're using Windows and present the links to the Windows installer.
  2. There are currently two versions of Python available: 3.x.x and 2.7.10. Python makes both available to download, but new users should choose the 3.x.x version. Download the 2.7.10 if you are going to be working with legacy Python code or with programs and libraries that haven't adopted 3.x.x yet.
    • This guide will assume you are installing 3.x.x.
    Advertisement
  3. Clicking the button for the version you want will download the installer for it. Run this installer after it has finished downloading.
  4. This will allow you to run Python directly from the Command Prompt.
  5. This will install Python with all of its default settings, which should be fine for most users.
    • If you want to disable certain functions, change the installation directory, or install the debugger, click "Customize installation" instead and then check or uncheck the boxes.
  6. To verify that Python is installed and working correctly, open the newly-installed interpreter. Click the Start button and type "python" to quickly open it.
  7. Python will open to a command line. Type the following command and press Enter to display "Hello world!" on the screen:
    print('Hello world!')
    
  8. Python comes with a development environment called IDLE. This allows you to run, test, and debug scripts. You can quickly launch IDLE by opening the Start menu and searching for "idle".
  9. Now that you've verified that Python is installed and working, you can start learning how to use it. See How to Start Programming in Python for some tips on learning how to use Python.
  10. Advertisement
Method 2
Method 2 of 3:

Mac

PDF download Download Article
  1. All versions of OS X come with Python 2.7 already installed. If you don't need the newer version of Python, you don't need to install anything. If you want access to the newest versions of Python, you'll want to install 3.x.x.
    • If you just want to use the included version of Python, you can create scripts in a text editor and run them through the terminal.
  2. Visit (python.org/downloads on your Mac. It should detect your operating system and show the Mac installation files. If it doesn't, click the "Mac OS X" link.
  3. Follow the prompts to install Python. Most users can just use the default settings.
  4. To verify that the installation went OK, launch the terminal and type python3. This should start the Python 3.x.x interface, and display the version.
  5. This program allows you to write and test Python scripts. You can find it in the Applications folder.
  6. IDLE will open an environment similar to a terminal screen. Type the following command and press Enter to display "Hello world!":
    print('Hello world!')
    
  7. Now that Python is installed, you can start using it to learn how to program. See How to Start Programming in Python for more instructions for Python beginners.
  8. Advertisement
Method 3
Method 3 of 3:

Linux

PDF download Download Article
  1. Nearly every distribution of Linux comes with Python installed. You can see what version you have by opening the Terminal and typing python.
  2. Open the Terminal window and type sudo apt-get install python.
    • You can also install Python using Ubuntu's Add/Remove Applications app located in the Applications window.
  3. Open the Terminal window and type sudo yum install python.
  4. Log in as the root user. Type pacman -S python.
  5. If you want to use the Python development environment, you can get it by using your distribution's software manager. Just search for "python idle" to find and install the package.
  6. Now that you have the latest version of Python installed, you can start learning how to use it to program. See How to Start Programming in Python for some tips on learning Python.
  7. Advertisement

Expert Q&A

Search
Add New Question
  • Question
    How do I check if a package is installed in Python?
    Kevin Burnett
    Kevin Burnett
    Software Developer
    Kevin Burnett is a Software Developer with over 20 years of professional experience. He works for SpiffWorkflow, a Python Process Automation tool for organizations. Prior to SpiffWorkflow, he spent the majority of his career at Rosetta Stone, a language-learning software company. He has experience with both front and back-end development and works primarily in Python, Ruby, and JavaScript. He attended the first RailsConf and the most recent PyCon US. He received an MBA and a BA in Computer Science and Spanish from Eastern Mennonite University.
    Kevin Burnett
    Software Developer
    Expert Answer
    You can use find spec, a built-in standard library tool within the Python program. You have to import lib.util first, and then you can use find spec. Then you give it the specific package that you want to learn more about. Find Spec can directly inform you if the package has been installed.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

Expert Interview

Thanks for reading our article! If you’d like to learn more about computer programming, check out our in-depth interview with Kevin Burnett.


You Might Also Like

Use Windows Command Prompt to Run a Python FileUse Windows Command Prompt to Run a Python File
Update Pip Upgrade Pip: Quick Guide for Beginners & Experts
Open a Python FileOpen a Python File
Comment Out Multiple Lines in Python Comment Out Multiple Lines in Python: Formatting & Shortcuts
Pip Uninstall Package Uninstall a Python Package With Pip: Step-by-Step Guide
Install Pip on Mac3 Easy Ways to Download & Install Pip on Your Mac
Change the Font Size in Python ShellChange the Font Size in Python Shell
Start Programming in PythonStart Programming in Python
Check Python Version on PC or Mac See the Python Version on Mac, Windows, and Linux
Program a Game in Python with PygameProgram a Game in Python with Pygame
Uninstall PythonUninstall Python
Make a Countdown Program in Python Code a Python Countdown Timer: Step-by-Step Guide
Write a Coin Flipping Program on PythonWrite a Coin Flipping Program on Python
Create Loops in Python Create Loops in Python
Advertisement

About This Article

Kevin Burnett
Co-authored by:
Software Developer
This article was co-authored by Kevin Burnett. Kevin Burnett is a Software Developer with over 20 years of professional experience. He works for SpiffWorkflow, a Python Process Automation tool for organizations. Prior to SpiffWorkflow, he spent the majority of his career at Rosetta Stone, a language-learning software company. He has experience with both front and back-end development and works primarily in Python, Ruby, and JavaScript. He attended the first RailsConf and the most recent PyCon US. He received an MBA and a BA in Computer Science and Spanish from Eastern Mennonite University. This article has been viewed 39,667 times.
How helpful is this?
Co-authors: 13
Updated: April 30, 2024
Views: 39,667
Categories: Python
Article SummaryX

1. Go to the Python download site.
2. Select a version to download.
3. Run the installer.
4. Select the option to add the directory to your PATH.
5. Click INSTALL NOW.
6. Open the Python interpreter.
7. Try a test script.

Did this summary help you?

Thanks to all authors for creating a page that has been read 39,667 times.

Is this article up to date?

Advertisement