#1
  1. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    Lawrence, Kansas [KU]
    Posts
    1,559
    Rep Power
    15

    mac os x python 2.4 question


    so i compiled python2.4 from source...but mac os x already had 2.3 (i got a mac for the first time like 3 days ago)

    but when i am in the terminal i want to be able to type "python" and get 2.4 and not 2.3, which is what i am getting now...so how do i do that?

    i know this is more of a unix question, i think, but this seems like the right place.

    thanks
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    The problem is that OSX uses python 2.3 for various things - we don't want to break that.

    I'd find where 2.3 is installed (not near a mac machine ATM otherwise I'd do it), easiest way is probably 'which python' in a terminal. Move this to python2.3

    Next find out where you installed 2.4 and soft link (ln -s) it to 'python' where 2.3 was above.

    If it doesn't work, or breaks stuff, just remove the soft link and rename python2.3 back.

    Comments on this post

    • jacktasia agrees : yes, sir
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    All you should need to do is add /usr/local/bin/ to your PATH variable before /usr/bin/

    Code:
    Mark-Smiths-Computer:~ Mark$ python
    Python 2.3 (#1, Sep 13 2003, 00:49:11) 
    [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>     
    Mark-Smiths-Computer:~ Mark$ PATH=/usr/local/bin/:$PATH
    Mark-Smiths-Computer:~ Mark$ python
    Python 2.4 (#1, Dec 12 2004, 22:12:51) 
    [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    Mark-Smiths-Computer:~ Mark$
    This will work in the current Terminal window until you close it, if you want to make this change last across multiple sessions then you need to add the following lines to your ~/.profile file and Quit Terminal.

    Code:
    PATH=/usr/local/bin/:$PATH
    export PATH
    Now when next open Terminal you will be able to access Python 2.4 via "python" .

    Personally I opted to leave Apples standard Python framework alone and instead have Python 2.3.5 and Python 2.4 as aliases: "python2.3" and "python2.4" respectively.

    Hope this helps,

    Mark .

    Comments on this post

    • jacktasia agrees : thank you sir
    programming language development: www.netytan.com Hula

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    Lawrence, Kansas [KU]
    Posts
    1,559
    Rep Power
    15

IMN logo majestic logo threadwatch logo seochat tools logo