Setting up Python

start

You want to program with Python and need help setting it up

goals

You will have a working Python setup on Windows (notes for Linux and Mac included)

Obtaining Python

Depending on your platform your first task might be to get Python installed. On Windows you can download the installer from the python.org download page. Python does not normally come pre-installed on Windows machines (at least - Microsoft doesn't install it by default!).

Macs have Python built-in and most Linux installs also have it pre-installed.

There are several flavours of Python that you could install for Windows. Take a look at the following video to see the main ones. Generally I just suggest going to python.org and getting their installer and then building up your packages but, if you're doing science, the scipy.org ones are a good place to start (as everything's pre-installed for you).

Deciding on a Python 2.5 Distro
votes 39
comments 58
Ian Ozsvald

Your first task is to pick the right Python distribution. At Python.org you can get the latest and greatest Python 2.5, with SciPy you get a math-oriented v2.5 and with ActivePython you get a complete but older v2.4 [edit March 2008 - ActivePython's [...]

To test if you have it, open a command prompt and type 'python' - if it runs (on Mac/Linux) then you already have it. If you don't you'll have to look further afield - do leave a comment below if you find a useful tutorial and we can include the information here.

Installing Python

Python for Windows

This video will give you an idea of how to install Python if you're using the stock installer from python.org. The other packages (scipy's and ActiveState's) have Windows installer packages and they're easy to follow.

Running Python 2.5 on Windows XP
votes 25
comments 99
Ian Ozsvald

Here we install and test Python 2.5 from Python.org (download here). I cover how to start Python from the Start Menu and writing your first (Hello World) line of Python code. At the end of this video you'll know how to start and finish with Python a [...]

If you installed Python using just the python.org installer (and possibly if you've used the other installers too) you will probably need to add python to the DOS path, this will show you how.

Adding Python to DOS Path
votes 22
comments 93
Ian Ozsvald

Python is not added to the DOS path by default. If you run 'python' from the command line you'll receive this error message: 'python' is not recognized as an internal or external command, operable program or batch file. Here I show you how [...]

Python for Mac

Python has been installed on Macs for a while, if you open a command prompt and type 'python' you should get the shell without any further work.

Python for Linux

Most Linux distributions (e.g. Ubuntu, RedHat) come with python pre-installed. If you can't get 'python' to run at the command line you'll have to consult your documentation - generally it is a matter of finding a one-line installer that will set it all up for you.

Getting easy_install

You'll also want easy_install - it is a command-line tool that makes it really (really!) easy to install new Python packages. This video shows you how to set it up on Windows, you can follow similar steps to get it working on Macs and Linux too.

Installing easy_install with ez_setup.py
votes 13
comments 27
Ian Ozsvald

Here we install easy_install using ez_setup.py (linked on the easy_install page). easy_install lets you install many python packages using a 1-line install command - just like using apt-get or rpms on Linux. On Windows you might need to setup your D [...]

And Now...

To continue your education, take a look here:

Ian Ozsvald and Horst Jens and Lucas Holland and gasto and John Montgomery and Kyran Dale and Jeff Rush and André Roberge

Aimed at new Python programmers, we're assuming you know a tiny bit about programming and nothing about using Python

How to read and write simply Python programs and running them

The RST-script for this Learning-path

The script below was used to generate the learning-path page above.

===========================================================
Setting up Python
===========================================================

.. authors::  71 79 3253 11 8 709        

.. contents::

start
=====
You want to program with Python and need help setting it up

goals
=====
You will have a working Python setup on Windows (notes for Linux and Mac included)

Obtaining Python
================

Depending on your platform your first task might be to get Python installed.  On Windows you can download the installer from the python.org `download <http://python.org/download/>`_ page.  Python does not normally come pre-installed on Windows machines (at least - Microsoft doesn't install it by default!).

Macs have Python built-in and most Linux installs also have it pre-installed.

There are several flavours of Python that you could install for Windows.  Take a look at the following video to see the main ones.  Generally I just suggest going to python.org and getting their installer and then building up your packages but, if you're doing science, the `scipy.org <http://scipy.org/>`_ ones are a good place to start (as everything's pre-installed for you).

.. video:: 136

To test if you have it, open a command prompt and type 'python' - if it runs (on Mac/Linux) then you already have it.  If you don't you'll have to look further afield - do leave a comment below if you find a useful tutorial and we can include the information here.

Installing Python
=================

Python for Windows
------------------

This video will give you an idea of how to install Python if you're using the stock installer from python.org.  The other packages (scipy's and ActiveState's) have Windows installer packages and they're easy to follow.
    
.. video:: 137

If you installed Python using just the python.org installer (and possibly if you've used the other installers too) you will probably need to add python to the DOS path, this will show you how.

.. video:: 294

Python for Mac
--------------

Python has been installed on Macs for a while, if you open a command prompt and type 'python' you should get the shell without any further work.

Python for Linux
----------------

Most Linux distributions (e.g. Ubuntu, RedHat) come with python pre-installed.  If you can't get 'python' to run at the command line you'll have to consult your documentation - generally it is a matter of finding a one-line installer that will set it all up for you.

Getting easy_install
====================

You'll also want easy_install - it is a command-line tool that makes it really (really!) easy to install new Python packages.  This video shows you how to set it up on Windows, you can follow similar steps to get it working on Macs and Linux too.

.. video:: 591

And Now...
==========

To continue your education, take a look here:

.. path:: 11

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Please provide your email address (won't be published)

I wanna learn python guys how do I start.....Ill proceed.


5. Piyush madhamshettiwar Wed, 13 Jan 2010 17:14

Thank you very much for such a nice tutorial.


4. Piyush madhamshettiwar Wed, 13 Jan 2010 17:14

Thank you very much for such a nice tutorial.


thanks