When you run a python program on Windows, you may want to know whether the Python version is 32-bit to 64-bit, because some issues may happen when you run the python program with the wrong python bit version. This article will tell you how to check whether you python is 32-bit or 64 bit after you install it.
1. How To Check If Python Is 32 Or 64-bit Windows.
There are 2 methods to check if python is 32 or 64-bit version on windows.
1.1 Method 1.
- Input the keyword cmd in the Windows OS Type here to search text box.
- Press Enter key to open a Dos window.
- Input the command python in the dos command line, press Enter key to run it.
- Then it will display some Python-related information. From the first text line, we can see the python is the 32-bit version ( MSC v.1915 32 bit (Intel) ).
>python Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
- If the python is a 64-bit version, then it will display the below text ( MSC v.1916 64 bit (AMD64) ) when you run the python command.
Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
1.2 Method 2.
- You can also run the below python script to check if python is 32 or 64-bit version.
# First import struct module. >>> import struct >>> # Return 64 means 64-bit version, return 32 means 32-bit version. >>> version = struct.calcsize("P")*8 >>> >>> print(version) 64