title: How do I compile and run 32-bit Python on 64-bit CentOS 6?
body: <p>I need to run 32-bit Python in 64-bit CentOS.</p>
  
  <h2>Background</h2>
  
  <p>I have a PCI-GPIB interface card. Its drivers are from <a href="http://www.ni.com/download/ni-488.2-2.9/2636/en/" rel="noreferrer">National Instruments</a>. It says in the drivers page:</p>
  
  <blockquote>
    <p>NI-488.2 version 2.9 supports 64-bit kernels. The driver may currently be used only from 32-bit applications.</p>
  </blockquote>
  
  <h2>Using the driver from Python</h2>
  
  <p>I use <a href="http://pyvisa.readthedocs.org" rel="noreferrer">PyVISA</a> wrapper to use the driver, like so:</p>
  
  <pre><code>import visa
  </code></pre>
  
  <p>However, I get the following error:</p>
  
  <pre><code>OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: wrong ELF class: ELFCLASS32
  </code></pre>
  
  <h2>Question</h2>
  
  <p>National Instruments says that their driver supports 64-bit kernels. <strong>Good</strong>.<br>
  But it can only be used from <em>within</em> 32-bit applications. <strong>Bad</strong>. My Python installation (which I compiled myself) is 64-bit.</p>
  
  <h3>How do I compile 32-bit Python in 64-bit CentOS 6?</h3>