Changes between Version 2 and Version 3 of PythonGuidelines


Ignore:
Timestamp:
Mar 8, 2010 2:54:07 PM (14 years ago)
Author:
Chris Jerdonek
Comment:

Added preliminary instructions on how to install new versions of Python on a Mac.

Legend:

Unmodified
Added
Removed
Modified
  • PythonGuidelines

    v2 v3  
    1111 * Most of WebKit's Python scripts require Python 2.5 to run.
    1212
    13 == Upgrading Python ==
     13== Installing a new version of Python ==
    1414
    15 FIXME: fill in this section.
     15[Most of these instructions are Mac-specific.]
    1616
    17 == Mac OS X Snow Leopard ==
     17You can tell what version of Python you are currently using by typing--
     18{{{
     19python -V
     20}}}
    1821
    19 (This section may not be necessary.  WebKit is still discussing what Python versions we need to support.)
     22Before trying to install a new version, check whether your machine already has other versions installed.  From a Mac, you can try reading the man page--
     23{{{
     24man python
     25}}}
     26On Snow Leopard you will find that your machine comes with Python 2.5, 2.6, and 3.0.  The man page also provides instructions on how to switch your system between these system-installed versions.
    2027
    21 Python 2.4 is not officially installed or supported on Snow Leopard (Mac OS X 10.6).  Because of this, you may need to install Python 2.4 yourself.  After installing [http://guide.macports.org/ MacPorts], you should be able to install Python 2.4 and python_select as follows (roughly).  python_select allows you to quickly go back and forth between Python versions:
     28If you need to install a new version not on your machine, you can use [http://guide.macports.org/ MacPorts] to do this.  MacPorts allows you to install Python versions alongside your system versions without interfering with them.  After installing MacPorts, simply type (for example)--
     29{{{
     30sudo port install python26
     31}}}
     32We recommend that Tiger users with 2.3 install Python 2.6 for starters.
    2233
    23  * Type `sudo port install python24`
    24  * Type `sudo port install python_select`
    25  * Then you should be able to type select Python 2.4 using, for example,`sudo python_select python24`.
    26  * Use `python_select -l` to find out what versions are available on your machine.
     34You should probably also install python_select using MacPorts--
     35{{{
     36sudo port install python_select
     37}}}
    2738
     39The python_select command allows you to quickly go back and forth between Python versions, like so--
     40{{{
     41> python -V
     42Python 2.6.4
     43> sudo python_select python24
     44Selecting version "python24" for python
     45> python -V
     46Python 2.4.6
     47}}}
     48
     49To find out what versions of Python you can switch to using python_select, type--
     50{{{
     51python_select -l
     52}}}
     53
     54