title: cython import error in same package
body: <p>I've seen <a href="https://stackoverflow.com/questions/48387310/importerror-in-cython">this question</a> and the answer don't seems to be working. Following is my directory structure.</p>
  
  <pre><code>.
  ├── my_package
  │   ├── a.pyx
  │   ├── b.pyx
  │   ├── b.pxd
  │   ├── test.py
  │   └── __init__.py
  └── setup.py
  </code></pre>
  
  <p>a.pyx file </p>
  
  <pre><code>cimport my_package.b  as b
  
  class a:
      def __init__(self):
          self.b = b.b()
          self.b.run()
  </code></pre>
  
  <p>b.pyx file</p>
  
  <pre><code>cdef class b:
  
      def __init__(self):
          pass
  
      cpdef run(self):
          print "b is running"
  </code></pre>
  
  <p>b.pxd file</p>
  
  <pre><code>cdef class b:
      cpdef run(self)
  </code></pre>
  
  <p>test.py</p>
  
  <pre><code>import a
  
  c = a.a()
  </code></pre>
  
  <p>setup.py</p>
  
  <pre><code>from distutils.core import setup
  from distutils.extension import Extension
  from Cython.Build import cythonize
  import numpy
  
  extensions = [
      Extension("my_package.a", ["my_package/a.pyx"]
          ),
      Extension("my_package.b", ["my_package/b.pyx"]
  )
  ]
  
  for e in extensions:
      e.cython_directives = {"embedsignature": True}
  
  setup(
      name = "preprocess",
      ext_modules = cythonize(extensions),
  )
  </code></pre>
  
  <p>after running <code>python setup.py build_ext --inplace</code> there is no compile error. But if I try to run test.py it gives <code>ImportError: No module named my_package.b</code>. </p>
  
  <p>Any input will be appreciated. </p>
  
  <p>BTW if we change the first line of a.pyx from <code>cimport my_package.b  as b</code> to <code>import b</code> it will work.</p>