1

When downloading the python 2.7.5 here, I download the python installer with the link "Python 2.7.5 Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6 and later [2])". Installed the python, I cd the directory "/Library/Frameworks/Python.framework/Versions/2.7" and execute the following python code:

 import sys
 print sys.maxint

and I get 2147483647 which means I am runing the python of 32bit version. How can I install the python of 64bit version?

jerry_sjtu
  • 5,216
  • 8
  • 29
  • 42

1 Answers1

1

Make sure you are really running the Python you think you are. cd /Library/Frameworks/Python.framework/Versions/2.7 doesn't help by itself. If you did not change any of the default installer options, /Library/Frameworks/Python.framework/Versions/2.7/bin should now be first in your shell PATH (you need to open a new terminal window after installing to see this) and there should now be python and python2.7 links in /usr/local/bin to the new Python.

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.maxsize
9223372036854775807
>>> sys.maxint
9223372036854775807
Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • Actually, I do enter the directory with the command " cd /Library/Frameworks/Python.framework/Versions/2.7/bin" and launch python with the command "./python". When executing the python above, I get the same result in my question. But after I reinstall the python, everything works fine though I don't know why. Thanks. – jerry_sjtu Aug 24 '13 at 03:44