I am having trouble compiling exe when using cx_freeze and scipy. In particular, my script uses
from scipy.interpolate import griddata
The build process seems to have completed successfully, however, when I try to run the compiled exe, I get the following message.
Traceback (most recent call last): File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module> exec(code, m.__dict__) File "gis_helper.py", line 13, in <module> File "C:\Python27\lib\site-packages\scipy\__init__.py", line 103, in <module> raise ImportError(msg) ImportError: Error importing scipy: you cannot import scipy while being in scipy source directory; please exit the scipy source tree first, and relaunch your python intepreter.
After viewing the scipy \ _init __. Py file, the following exists:
if __SCIPY_SETUP__: import sys as _sys _sys.stderr.write('Running from scipy source directory.\n') del _sys else: try: from scipy.__config__ import show as show_config except ImportError: msg = """Error importing scipy: you cannot import scipy while being in scipy source directory; please exit the scipy source tree first, and relaunch your python intepreter.""" raise ImportError(msg)
I'm not quite sure that this is a problem, although it seems that erros is throwing because there is a problem with the scipy configuration file. It may not be included in the build process. I am new and hope that someone more experienced in building an assembly using cxfreeze can shed some light on this.
By the way, the scipy used was installed from binary files here .
source share