0

I've come to a question regarding how to install 32 bit Python on Linux and another one on Windows. After reading I decided to find out which python I had, if it was 32 or 64 bits.

I've tried the following, but the difference in the results bugged me:

Python 2.7

import sys
sys.getsizeof(int(1))
>>> 24

Python 3.6

import sys
sys.getsizeof(int(1))
>>> 28

This answer helped me understand it, but I don't know a proper way to find out if I have 32 or 64 bit python.

Bernardo Duarte
  • 4,074
  • 4
  • 19
  • 34
  • 2
    Does this answer your question? [How do I determine if my python shell is executing in 32bit or 64bit mode on OS X?](https://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode-on-os) – AMC Mar 10 '20 at 19:11
  • Another one: https://stackoverflow.com/questions/1842544/how-do-i-detect-if-python-is-running-as-a-64-bit-application – AMC Mar 10 '20 at 19:12
  • @AMC The last one has some problems that states the it is not [reliable](https://stackoverflow.com/questions/6107905/which-command-to-use-for-checking-whether-python-is-64bit-or-32bit/12057504#comment16107570_12057504) – Bernardo Duarte Mar 10 '20 at 19:14
  • Yes, although the other answer to that post looks alright. – AMC Mar 10 '20 at 19:15
  • @AMC Yes, thanks for that! The first one catches most problems, also mentions some caveats. I could wonder about python <2.6 versions but that would be another question. – Bernardo Duarte Mar 10 '20 at 19:18
  • 1
    You're welcome, good luck :) – AMC Mar 10 '20 at 19:19

0 Answers0