Upgrade Python to 2.6 on Mac

I'd like to upgrade the default python installation (2.5.1) supplied with OS X Leopard to the latest version. Please let me know how I can achieve this.

Thanks


Asked by: Roman925 | Posted: 06-12-2021






Answer 1

When an OS is distributed with some specific Python release and uses it for some OS functionality (as is the case with Mac OS X, as well as many Linux distros &c), you should not tamper in any way with the system-supplied Python (as in, "upgrading" it and the like): while Python strives for backwards compatibility within any major release (such as 2.* or 3.*, this can never be 100% guaranted; your OS supplied tested all functionality thoroughly with the specific Python version they distribute; if you manage to alter that version, "on your head be it" -- neither your OS supplier nor the PSF accepts any responsibility for whatever damage that might perhaps do to your system.

Rather, as other answers already suggested, install any other release you wish "besides" the system one -- why tamper with that crucial one, and risk breaking things, when installing others is so easy anyway?! On typical Mac OS X 10.5 machines (haven't upgraded any of my several macs to 10.6 yet), I have the Apple-supplied 2.5, a 2.4 on the side to support some old projects not worth the bother to upgrate, the latest 2.6 for new stuff, 3.1 as well to get the very newest -- they all live together in peace and quiet, I just type the release number explicitly, i.e. using python2.6 at the prompt, when I want a specific release. What release gets used when at the shell prompt you just say python is up to you (I personally prefer that to mean "the system-supplied Python", but it's a matter of taste: by setting paths, or shell aliases, &c, you can make it mean whatever you wish).

Answered by: Sydney909 | Posted: 07-01-2022



Answer 2

Don't upgrade.

  1. Install ActivePython (which co-exists with others).
  2. Open Terminal
  3. Type python2.6

Answered by: Ned541 | Posted: 07-01-2022



Answer 3

May I suggest you leave the "Default" be, and install Python in /usr/local/bin.

  1. Download python
  2. Unzip it
  3. ./configure
  4. make
  5. sudo make install

done.

Since /usr/local/bin comes before /usr/bin in the $PATH, you will invoke 2.6 when you type python, but the OS will remain stable...

Answered by: Maddie188 | Posted: 07-01-2022



Answer 4

You have a number of options

  • Install with MacPorts or Fink, e.g.:

    sudo port install python2.6
    
  • Install from the disc image from python.org
  • Install from source:

    tar xzvf Python-2.6.3.tgz
    cd Python-2.6.3
    ./configure && make && sudo make install
    

Answered by: Kristian370 | Posted: 07-01-2022



Answer 5

The best is to use macports (just like Adam Rosenfield stated on this thread).

You can easily switch between Python versions using macports select mechanism:

$ sudo port select --set python pythonXY

To view the list of available Python versions you can use above and/or confirm which one you're using:

$ sudo port select --list python

To install a new Python version:

$ sudo port install pythonXY

Answered by: Ryan926 | Posted: 07-01-2022



Answer 6

The standard http://python.org install for Mac OSX will happily coexist with the "system python". If you let the installer change your paths, when you run python from a prompt in terminal, it will find the version at

 /Library/Frameworks/Python.framework/Versions/2.6/bin/python

However, this won't interfere with anything that OSX itself does with python, which correctly hardwires the path to the version that it installs.

Answered by: Adelaide632 | Posted: 07-01-2022



Answer 7

I believe there are a few options. The one I like is to install alternative UNIX software on my Macs using MacPorts, http://www.macports.org/ -- this way the new software is installed in a different directory and won't mess up anything depending on the apple-installed version, and macports also has a nice way of keeping their installed software up to date. I believe MacPorts helps take care of dependencies as well.

Answered by: Steven570 | Posted: 07-01-2022



Similar questions

macos - How to upgrade to python 3.5 from 2.7 in Mac OSX

How to upgrade from python 2.7 to 3.5 in Mac OSX? I downloaded python 3.5 .dmg file and installed it. what are the changes I should make for PYTHONPATH and PATH? Is it possible to use both without any issues using virtualenv ?


python - upgrade TLS 1.0 to TLS 1.2 on macOS

I have troubles installing some python packages I believe because I have TLS 1.0 version. How do I upgrade to TLS 1.2? python -c "import urllib2; import json; print(json.loads(urllib2.urlopen('https://www.howsmyssl.com/a/check').read())['tls_version'])" TLS 1.0 My macOS version: 10.13.4 (17E202) python version: Python 2.7.13 openssl version: LibreSSL 2.2.7 I tried to upgrad...


How do I upgrade python 2.5.2 to python 2.6rc2 on ubuntu linux 8.04?

I'd like to how to upgrade the default python installation(2.5.2) supplied with ubuntu 8.04 to python 2.6rc2. I'd like to make 2.6 the default python version on the system and migrate all the other useful installed python libraries installed on 2.5.2 to python 2.6rc2. Please let me know how I can achieve this. Thanks Dirk


macos - Trying to upgrade Python to 3.0 on Mac OS 10.5.8

I'm having some problems upgrading Python on my Mac. For my first attempt, I downloaded and installed the 2.6.4 dmg MacPython installer from http://python.org/download/mac/. This did install 2.6.4, and when I ran 'python' from the terminal it says that version. However, I also had a test script where I am doing: import os, json ...


Upgrade python to 2.7 and Django to 1.4, but it tells me No module named *

I have just upgraded my python to 2.7 on my Ubuntu server, and reinstalled the Django to 1.4. I use python flup to run the Django application as fastcgi, but when I try to restart the application, it keeps telling me No module named * e.g. File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) ... File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", l...


macos - Python pip broken after OS X 10.8 upgrade

Made the upgrade to Mac OS X 10.8 (Mountain Lion) and get now the following error when trying to call $ pip: Traceback (most recent call last): File "/usr/local/bin/pip", line 5, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module> working_set.requ...


upgrade python from 2.4 to 2.6 in plone

I am trying to upgrade my plone version from 3.3.5 to 4.0. For this I went to this site: updating plone. But I got stuck in the first point. In plone 3, I have python version of 2.4. But for plone 4.x I will need python 2.6. How do I upgrade my python version? In my buildout.cfg I have:


python - NumPy won't upgrade from 1.5.1 to 1.6.2 on OS X 10.7

I am attempting to update/upgrade my NumPy, but am failing. I think I might have multiple versions of NumPy installed in different directories, but python by default imports an old one. Any help? Here's where my Python is: Gonzo-vs-Kitties:~ brian$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python Here's the version that Python imports: Gonzo...


Upgrade Python 2.4 to 2.6 or 3.0

I am running Python 2.4 on Redhat Linux 5. Any idea how to upgrade to either Python 2.6 or 3.0? Thanks in advance, Sum


Should I upgrade python 2.7.3 to 2.7.4

The reason I ask is that some of the packages I have installed were specific to 2.7.3 as windows installers from PyPI. Would these need to be re-installed or would pip update these? Thanks.


python - Can't upgrade Scipy

I'm trying to upgrade Scipy from 0.9.0 to 0.12.0. I use the command: sudo pip install --upgrade scipy and I get all sorts of errors which can be seen in the pip.log file here and I'm unfortunately not python-savvy enough to understand what's wrong. Any help will be appreciated.


python - Upgrade to numpy 1.8.0 on Ubuntu 12.04

I'm running Ubuntu 12.04 which comes by default with NumPy 1.6.0 (I have, actually had, Python 2.7.3 installed). As a result of the answer to this question polyfit() got an unexpected keyword argument 'w', I need to upgrade it. I downloaded the .tar.gz packa...


How do I upgrade python 2.5.2 to python 2.6rc2 on ubuntu linux 8.04?

I'd like to how to upgrade the default python installation(2.5.2) supplied with ubuntu 8.04 to python 2.6rc2. I'd like to make 2.6 the default python version on the system and migrate all the other useful installed python libraries installed on 2.5.2 to python 2.6rc2. Please let me know how I can achieve this. Thanks Dirk


macos - Trying to upgrade Python to 3.0 on Mac OS 10.5.8

I'm having some problems upgrading Python on my Mac. For my first attempt, I downloaded and installed the 2.6.4 dmg MacPython installer from http://python.org/download/mac/. This did install 2.6.4, and when I ran 'python' from the terminal it says that version. However, I also had a test script where I am doing: import os, json ...


How to upgrade the version of Python used by Apache?

On a Red hat box, I upgraded Python from 2.3 to 2.6.4 and changed the symlink to python so when I type in python the 2.6.4 interpreter comes up. However my .py file works from the command-line, but not in the browser. It seemed like a sys.path issue so I opened the file in a browser and printed out sys.path. Surprisingly, my sys.path is differ...


build - How can I upgrade the sqlite3 package in Python 2.6?

I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in my application, so I tried upgrading to python 2.7. I'm using twisted, and I couldn't for the life...


Upgrade python to 2.7 and Django to 1.4, but it tells me No module named *

I have just upgraded my python to 2.7 on my Ubuntu server, and reinstalled the Django to 1.4. I use python flup to run the Django application as fastcgi, but when I try to restart the application, it keeps telling me No module named * e.g. File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) ... File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", l...


upgrade - How to make newest version of Python the default or first in path

I have installed a new version of Python, so I want to make sure when Python is invoked that version is first in my path. So, now on my 'C' drive I have "Python27" and "Python32" (old and new version, respectively). When I type "python" in the command line I get "Python 2.7". Using control panel I have changed the "path" and "pythonpath" user variables (from 'C:\Python27' to 'C:\Python32') and to be sure I have re...


macos - Python pip broken after OS X 10.8 upgrade

Made the upgrade to Mac OS X 10.8 (Mountain Lion) and get now the following error when trying to call $ pip: Traceback (most recent call last): File "/usr/local/bin/pip", line 5, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module> working_set.requ...


upgrade python from 2.4 to 2.6 in plone

I am trying to upgrade my plone version from 3.3.5 to 4.0. For this I went to this site: updating plone. But I got stuck in the first point. In plone 3, I have python version of 2.4. But for plone 4.x I will need python 2.6. How do I upgrade my python version? In my buildout.cfg I have:


python - NumPy won't upgrade from 1.5.1 to 1.6.2 on OS X 10.7

I am attempting to update/upgrade my NumPy, but am failing. I think I might have multiple versions of NumPy installed in different directories, but python by default imports an old one. Any help? Here's where my Python is: Gonzo-vs-Kitties:~ brian$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python Here's the version that Python imports: Gonzo...


Upgrade Python 2.4 to 2.6 or 3.0

I am running Python 2.4 on Redhat Linux 5. Any idea how to upgrade to either Python 2.6 or 3.0? Thanks in advance, Sum






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top