title: ImportError: cannot import name constants
body: <p>I'm trying to run a simple piece of code using pyzmq. I am using Python 2.7 and pyzmq 14.5</p>
  <pre><code>$ python --version
  Python 2.7.6
  $ sudo find /usr -name &quot;*pyzmq*&quot;
  /usr/local/lib/python2.7/dist-packages/pyzmq-14.5.0.egg-info
  /usr/lib/python2.7/dist-packages/pyzmq-14.0.1.egg-info
  </code></pre>
  <p>Following is the code i'm trying to run:</p>
  <pre><code>import zhelpers
  
  context = zmq.Context.instance()
  server = context.socket(zmq.ROUTER)
  server.bind(&quot;tcp://*:5678&quot;)
  
  while (1):
      address, empty, data = server.recv_multipart()
  
      print(&quot;address = %s, data = %d&quot; % (address, int(data)))
  
      data_i = int(data) + 10
      server.send_multipart([
          address,
          b'',
          str(data_i),
      ])
  </code></pre>
  <p>But, I'm getting following error and got no clue how to fix this:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;reqrep_server.py&quot;, line 8, in &lt;module&gt;
      import zhelpers
    File &quot;/home/arun/pyzmq_server/zhelpers.py&quot;, line 11, in &lt;module&gt; 
      import zmq
    File &quot;/home/arun/pyzmq_server/zmq/__init__.py&quot;, line 66, in &lt;module&gt;
      from zmq import backend
    File &quot;/home/arun/pyzmq_server/zmq/backend/__init__.py&quot;, line 41, in &lt;module&gt;
      reraise(*exc_info)
    File &quot;/home/arun/pyzmq_server/zmq/backend/__init__.py&quot;, line 29, in &lt;module&gt;
      _ns = select_backend(first)
    File &quot;/home/arun/pyzmq_server/zmq/backend/select.py&quot;, line 27, in select_backend
      mod = __import__(name, fromlist=public_api)
    File &quot;/home/arun/pyzmq_server/zmq/backend/cython/__init__.py&quot;, line 6, in &lt;module&gt;
      from . import (constants, error, message, context, socket, utils, _poll, _version, _device)
  ImportError: cannot import name constants
  </code></pre>
  <p>I've copied the whole <strong>zmq</strong> folder and placed it in the level as my .py file.</p>
  <p>Please help!</p>
  <p><strong>EDIT:</strong></p>
  <p>I've removed those two versions of pyzmq and reinstalled latest pyzmq (with libzmq bundled this time) as instructed <a href="https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ" rel="noreferrer">here</a>.</p>
  <pre><code>$ sudo find /usr -name &quot;*pyzmq*&quot;
  /usr/local/lib/python2.7/dist-packages/pyzmq-14.7.0-py2.7.egg-info
  
  $ sudo find /usr -name &quot;*libzmq*&quot;
  /usr/local/lib/libzmq.so
  /usr/local/lib/libzmq.la
  /usr/local/lib/libzmq.so.5.0.0
  /usr/local/lib/pkgconfig/libzmq.pc
  /usr/local/lib/libzmq.so.5
  /usr/local/lib/python2.7/dist-packages/zmq/libzmq.so
  /usr/local/lib/python2.7/dist-packages/zmq/backend/cython/libzmq.pxd
  /usr/local/lib/libzmq.a
  </code></pre>
  <p>But this doesn't solve the problem. I'm getting the same error!</p>