Import error in py2exe

48 views
Skip to first unread message

Fumihiro Bessho (Ben)

unread,
Jul 15, 2014, 8:24:09 AM7/15/14
to pyamg...@googlegroups.com
Hi, I'm creating an exe file using py2exe.
I could created an exe file but I got the following error when I run the file.

Traceback (most recent call last):
  File "gui.py", line 8, in <module>
  File "poissonblending.pyc", line 7, in <module>
  File "pyamg\__init__.pyc", line 22, in <module>
ImportError: Error importing pyamg: you cannot import pyamg while
    being in pyamg source directory; please exit the pyamg source
    tree first, and relaunch your python interpreter.

I couldn't find anything in Google. Does anyone point me out what's wrong with this?

It's my setup.py and I'm using the following versions
  • disutils 2.7.2
  • py2exe 0.6.9
  • pyamg 2.1.0

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
import numpy
import py2exe
setup(
    windows=['gui.py'],
    options={
        'py2exe': {
            r'includes': [r'scipy.sparse.csgraph._validation',
                          r'scipy.special._ufuncs_cxx']
        }
    }
)

Regards,

Jacob Schroder

unread,
Jul 15, 2014, 2:13:49 PM7/15/14
to pyamg...@googlegroups.com
Hi Ben,

Unfortunately, I don't have experience with py2exe. But judging from
your error, make sure that you don't run your python executable from
the pyamg directory. That is, move the executable to some other
directory (not within the pyamg directory) and then try running it.

Hope this helps,

Jacob
> --
> You received this message because you are subscribed to the Google Groups
> "pyamg-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyamg-user+...@googlegroups.com.
> To post to this group, send email to pyamg...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pyamg-user.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages