title: How to make compiled __init__ module extensions work properly?
body: <p>I'm using the 64-bit version of python 3.3 and cython 0.18 on Windows 7.</p>
  
  <p>I've encountered a problem that is thoroughly described <a href="http://thread.gmane.org/gmane.comp.python.devel/135764" rel="nofollow">here</a></p>
  
  <p>One issue that was not discussed in the linked thread was, that the python's distutils called the link command (<em>link.exe</em>) with an option to export (this is only needed on Windows) a symbol named <em>PyInit_[module name]</em> but, if the module name was <em><strong>__init__</strong></em> the cython-created C file only specified a symbol with name <em>PyInit_[package name]</em> and the linker gave back this error: <em>LINK : error LNK2001: unresolved external symbol</em>.</p>
  
  <p>Fortunately, I managed to fix this issue in the <em>build_ext</em> module.</p>
  
  <p>The problem that remains is that a compiled <em><strong>__init__</strong>.pyd</em> module of <em>mypackage</em> containing an import statement like</p>
  
  <pre><code>import math
  </code></pre>
  
  <p>Throws an </p>
  
  <pre><code>SystemError: Parent module '' not loaded, cannot perform relative import
  </code></pre>
  
  <p>When <em>mypackage</em> is imported (no matter from where it is imported). Without import statements it works as expected though.</p>
  
  <p>If anyone has a fix, workaround or information that could solve this problem or could explain why it's not (yet) solvable please, share your knowledge.</p>