Py2exe error: Parent module '' not loaded, cannot perform relative import
Dupe of #9474 

---

Py2exe error: Parent module '' not loaded, cannot perform relative import

I am using Windows, Python 3.3.5, pandas 0.15.2, and py2exe 0.9.2.2.

I used py2exe to generate a single-file executable from a Python script that uses pandas 0.15.2. When I tried to run it, I got the following error: `Parent module '' not loaded, cannot perform relative import`.

This is how it happened. I created a file named `test.py` with the following content.

```
import pandas
print(pandas.__version__)
```

For py2exe, I created a file called `setup.py`, with the following content.

```
import py2exe
import sys
from distutils.core import setup

sys.argv.append('py2exe')

setup(
    options={
        'py2exe': {
            'bundle_files': 0,
            'excludes': [ 'tkinter']
        }
    },
           console=['test.py'],
    zipfile=None,
)
```

I ran `python setup.py`. I verified that the file `dist/test.exe` had been generated.

When I tried to run `test.exe`, I got the following traceback:

```
C:\mac\des\ide\test\panbug\dist>test
OMP: Warning #178: Function GetModuleHandleEx failed:
OMP: System error #126: No se puede encontrar el m¾dulo especificado.
Parent module '' not loaded, cannot perform relative import
Traceback (most recent call last):
  File "test.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "C:\mac\des\WinPython-32bit-3.3.5.0\python-3.3.5\lib\site-packages\zipextimporter.py", line 86, in load_module
    return zipimport.zipimporter.load_module(self, fullname)
  File "C:\mac\des\WinPython-32bit-3.3.5.0\python-3.3.5\lib\site-packages\pandas\__init__.py", line 7, in <module>
    from . import hashtable, tslib, lib
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "C:\mac\des\WinPython-32bit-3.3.5.0\python-3.3.5\lib\site-packages\zipextimporter.py", line 109, in load_module
    self.get_data)
  File "pandas\hashtable.pyx", line 9, in init pandas.hashtable (pandas\hashtable.c:23000)
SystemError: Parent module '' not loaded, cannot perform relative import
```

There is a workaround that consists on downgrading to pandas 0.14.1 **and** removing the `bundle_files` option (which generates a folder with a bunch of files instead of a single-file executable). However, I need a single-file executable, and would also like to use the latest pandas version.

Also, I know that I'm not the only one facing this issue. There is a [related question](http://stackoverflow.com/questions/28433559/pandas-py2exe-error-parent-module-not-loaded-cannot-perform-relative-impo) on StackOverflow.
