← Go Back

How to Check if the Running Python or OS Is 64-Bit

To check if the Python interpreter is 64-bit the official documentation suggests:

>>> import sys
>>> is_64bits = sys.maxsize > 2**32
>>> is_64bits
True

Note that a 32-bit Python interpreter can be installed on a 64-bit operating system. To find out if the operating system is 64-bit, use the platform standard module:

>>> import platform
>>> is_os_64bit = platform.machine().endswith('64')
>>> is_os_64bit
True



platform sys


🐍 You might also find interesting: