How to install 64-bit python on Ubuntu

Christian Heimes lists at cheimes.de
Wed Oct 7 19:55:48 EDT 2009


Curious schrieb:
> On Oct 7, 4:07 pm, Roger Binns <rog... at rogerbinns.com> wrote:
>> Curious wrote:
>>> Ubuntu comes pre-installed with Python2.6 but this python installation
>>> is a 32 bit installation.
>> For 64 bit Ubuntu you are mistaken:
>>
>> $ file /usr/bin/python2.6
>> /usr/bin/python2.6: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
>> dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
>>
>>> I do the following to know if the current python installation is 32-
>>> bit or 64-bit:
>> This is what I do:
>>
>>>>> import ctypes
>>>>> ctypes.sizeof(ctypes.c_void_p)
>> 8
>>
>> Roger
> 
> Thanks very much for you response, Roger!
> 
> I am sorry but I am not able to follow what you are saying. I am quite
> new to linux installation world and it's possible that I am missing
> pretty straightforward info.
> 
> Did you mean to say that Ubuntu does come pre-installed with 64-bit
> Python? When I used the same command as you did, I see a 32-bit
> version there. I am not sure how to get to 64-bit.

I bet your Ubuntu installation is 32bit, too. You need a 64bit
installation of Ubuntu in order to run a 64bit version of Python. By
default Python is compiled in the same flavor as the OS. What does
"uname -m" show? It should print "x86_64" for a 64bit version of Linux.

--enable-universalsdk and  --with-universal-archs have no function on
Linux. They are Mac OS X only options.

Christian




More information about the Python-list mailing list