Determining 32 bit vs 64 bit Python and numpy

G

Guest

Hi

I am looking for a robust, cross-platform way to determine if I am on a
32 bit or a 64 bit Python and if the numpy installation is also 32 bit
or 64 bit.

I have googled a bit and found some platform specific solutions but
nothing general.

The solution should work with different versions of Python (>= 2.4).

Thanks in advance

Martin
 
M

Martin v. Löwis

I am looking for a robust, cross-platform way to determine if I am on a
32 bit or a 64 bit Python and if the numpy installation is also 32 bit
or 64 bit.

You can find out the size of a pointer with struct.calcsize("P") * 8.
Numpy will have the same configuration if you can import it.

Regards,
Martin
 
G

Guest

You can find out the size of a pointer with struct.calcsize("P") * 8.
Numpy will have the same configuration if you can import it.


That works great. Thank you.

Best Regards

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top