top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between 32 and 64 bit Python on Windows 7 64 bit?

+2 votes
1,041 views

I want to install Python on a PC with the 64 bit version of Windows 7. I want Python to be able to use as much as possible of the RAM.

When I install the 64 bit version of Python I find that sys.maxint == 2**31 - 1 Whereas the Pythpon installed on my 64 bit linux system returns sys.maxint == 2**63 - 1.

It looks to me as though 32 and 64 bit versions of Python on 64 bit Windows are both really 32 bit Python, differing only in how they interact with Windows. So I wouldnt expect 64 bit Python running on 64 bit Windows to allow the large data struictures I could have with 64 bit Python running on 64 bit linux.

Is that true?I have spent a couple of hours searching for a definitive description of the difference between the 32 and 64 bit versions of Python for Windows and haven't found anything.

posted May 11, 2014 by Abhay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

Since sys.maxint is gone in 3.x, you must be using some version of 2.x. Do yourself a favor and install 3.4 unless you absolutely need 2.x.

With 3.4:

 >>> a = [None]***********
 >>> sys.getsizeof(a)
**********

That is ********** 8-byte pointers, as I expected.

answer May 11, 2014 by Bob Wise
0 votes

When I install the 64 bit version of Python I find that sys.maxint == 2**31 - 1 Whereas the Python installed on my 64 bit Linux system returns sys.maxint == 2**63 - 1.

That comes from the underlying C implementation. 64-bit MSVC still has long int as 32-bit. You need to specify long long int to get a 64-bit number even on a 64-bit compiler. Microsoft is a little nuts on the
backwards compatiblity.

Is that true? I have spent a couple of hours searching for a definitive description of the difference between the 32 and 64 bit versions of Python for Windows and haven't found anything.

long int (the size of an integer) != size_t (the size of an object). 64-bit Python still uses 64-bit pointers so it can still address more than 4GB of memory. It just rolls over into longs after 32-bit int max instead of after 64-bit int max.

answer May 11, 2014 by Amit Parthsarthi
Similar Questions
+3 votes

I'm new to Python. I downloaded the 64-bit build of Python 2.7.10 from www.python.org/downloads/release/python-2710. I run Windows 7 Pro on a Dell PC.

I find that the installation package creates a folder called "Python 2.7" in my Start menu, with both a command prompt and IDLE GUI options.

I hold my scripts in another directory that is parallel to but not under the one where Python 2.7 resides, so I set the Environment Variable PYTHONPATH to include the directory where my scripts reside. Unfortunately, I am unable to reach them in either the IDLE GUI or the "Python command line" in that folder in my start menu. The only way I have managed to run Python scripts is to open an ordinary command prompt from Accessories, navigate to the directory with the scripts, and run python from the command prompt in that directory.

Can anyone let me know what I'm not doing that I should be doing to run Python and my scripts from the parallel directory under the GUI or the command line from the start menu folder ?

+1 vote

I am trying to download a program into Windows 7 Professional 64-bit. The download program will not install their drivers and tells me to I need to get "64 bit DPInstall,exe" first.

Do I need something extra from Microsoft?

+2 votes

I am confused with all 32/64 bit architecture for Hardware/OS/Binary, Can someone please help in clarifying this queries?

  1. Of'course 64 bit hardware is faster than 32 bit, still there are people who prefer 32 bit over 64 bit hardware, Why so?
  2. If I have 32 bit Hardware then On that can I run 64 bit OS? (and vice versa)
  3. If I have a 64 bit Hardware and 32 bit OS then what will be the speed of my OS, as per 32 bit or as per 64 bit? (and vice versa)
  4. If I have 32 bit OS then can I run binary of 64 bit on that? (and vice versa)
  5. Is it necessary to compile binary with 32/64 bit both or we can compile with any and use it in both?
  6. Is the speed of the process also depends on type of binary that I have? For example, If I have 64 bit hardware and 64 bit OS but I have a binary which is compiled with 32 bit compiler then what will be the speed difference?

P.S. I know its basic and silly queries but lets clear now before it gets too late. :)

+5 votes

I want to know my laptop have 32 bit or 64 bit CPU not the OS type which can be seen from computer -> properties. Can it be possible to install window 7 64 bit on a 32 bit machine ?

...