Changes between Version 2 and Version 3 of PythonGuidelines

Mar 8, 2010 2:54:07 PM (13 years ago)
Chris Jerdonek

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


  • PythonGuidelines

    v2 v3  
    1111 * Most of WebKit's Python scripts require Python 2.5 to run.
    13 == Upgrading Python ==
     13== Installing a new version of Python ==
    15 FIXME: fill in this section.
     15[Most of these instructions are Mac-specific.]
    17 == Mac OS X Snow Leopard ==
     17You can tell what version of Python you are currently using by typing--
     19python -V
    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--
     24man python
     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.
    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 [ 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 [ 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)--
     30sudo port install python26
     32We recommend that Tiger users with 2.3 install Python 2.6 for starters.
    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--
     36sudo port install python_select
     39The python_select command allows you to quickly go back and forth between Python versions, like so--
     41> python -V
     42Python 2.6.4
     43> sudo python_select python24
     44Selecting version "python24" for python
     45> python -V
     46Python 2.4.6
     49To find out what versions of Python you can switch to using python_select, type--
     51python_select -l