3

After giving up on doing a disk partition and getting Linux, I decided to try and install Python 3.3.2 on a 32 bit Intel Core 2 Duo iMac with OS X 10.6.8 Snow Leopard. I did pretty much everything the official website says, but it isn't working at all.

First of all, I downloaded the installer for Mac OS X 6 and later, which should supposedly put a folder called MacPython 3.3 with IDLE, PythonLauncher and a Build Applet tool in my Applications folder. What I have instead is a folder called Python 3.3 which does contain (aside from the documentation and a command to update shell profile) IDLE and PythonLauncher, but no Build Applet tool; I typed 'python' into my Terminal window to see if 3.3.2 was installed, but it said Python 2.6.1 even after restarting my computer. The ReadMe in the disk image that contains the installer says running the installer should also 'put the underlying machinery into the folder /Library/Frameworks/Python.framework'. I did every search imaginable and apparently there is no such folder anywhere in my hard drive.

Basically, I want to install 3.3.2 and run things in programme mode rather than shell mode, which I find to be a huge pain in the bottom. Any help is greatly appreciated.

EDIT: found the Frameworks folder. Python.framework contains 4 folders named 2.3, 2.5, 2.6 and Current, which has several other folders inside – all for Python 2.6. The official page says I shouldn't delete any of them because they already come with Mac. How do I put 3.3 here?

9
  • What is programme mode and shell mode?
    – mmmmmm
    Jul 30, 2013 at 16:42
  • 1
    You have not found the Frameworks folder - the one you have found is /System/Library/Frameworks/Python.framework/Versions/ which is the Apple installed one the one you want is as the notes say under /Library - How are you looking for the path
    – mmmmmm
    Jul 30, 2013 at 16:44
  • According to the guide I'm reading, there are 2 ways to run Python applications, which are programme mode (as standalone applications) and shell mode (by typing commands one by one into the Python shell). Jul 30, 2013 at 16:49
  • what guide can you give a URL (also looking at my install looks like Build Applet is a python 2 thing - I don't have it either
    – mmmmmm
    Jul 30, 2013 at 16:52
  • Oh, there I found /Library. I figured it had to be /System/Library since the /Library in my home folder didn't have any frameworks, but turns out there's a third one with Python 3.3.2. Thanks! Jul 30, 2013 at 16:53

1 Answer 1

1

So your Mac is still looking for an old version of Python. You need to inform it that there is in fact a new version and where it can find it. To do this, you need to update the PATH to Python.

This can be done in your .bash_profile file.

# Setting PATH for Python 3.3.2.
# The original version is saved in .profile.pysave.
PATH="/Library/Frameworks/Python.framework/Versions/3.3.2/bin:${PATH}"
export PATH

After you update the .bash_profile file Terminal should run the new version of Python, when you ask for it.

4
  • 1
    Easier to use /usr/local/bin as the path
    – mmmmmm
    Jul 30, 2013 at 16:53
  • Thanks a lot! Could you tell me how to access the .bash_profile file? I tried searching for it and I couldn't find it. Jul 30, 2013 at 16:57
  • It does not exist by default - I would go and read a Unix tutorial to understand some shell programming
    – mmmmmm
    Jul 30, 2013 at 16:59
  • Ok, I understand some more about Unix now and I get what .bash_profile does. However, when I run the cat command on it I get exactly what IdeoREX posted – but if I type python I get 2.6.1. Should I move the file to another directory? It's in my home directory right now. Jul 31, 2013 at 5:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .