Laptops or Desktops are built with two architectures (32-bit and 64-bit). Most of them if not all of them nowadays are 64-bit based. 64-bit processor can run the 32-bit software as well. This allows some confusion with which package that's been installed on 64-bit machine.

I was running recently a Python program and it was a 32-bit build that was installed on my 64-bit laptop. The construct that I was using expects Python to be a 64-bit build given that it was trying to invoke other 64-bit software installed on the machine.

Here is the better way to find out your current installed Python version programmatically

  • Open Command Prompt or Terminal
  • Just type "python" and enter (sometimes you may have to type python3 if you've got both Python 2 and 3 installed on the PC)
  • You should see the Python terminal now... Enter the below command
    "import ctypes; print (8 * ctypes.sizeof(ctypes.c_voidp));"
  • If the above command returns 32, your Python installed is 32-bit
D:\Santhosh>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes; print (8 * ctypes.sizeof(ctypes.c_voidp));
32
>>> quit();