cx freeze - Scipy and CX_freeze - Error importing scipy: you cannot import scipy while being in scipy source directory -


i'm having trouble compiling exe while using cx_freeze , scipy. in particular, script uses

from scipy.interpolate import griddata 

the build process seems complete successfully, when try run compiled exe, 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: cannot import scipy while         being in scipy source directory; please exit scipy source         tree first, , relaunch python intepreter. 

after looking @ scipy\ _init__.py file, there following:

if __scipy_setup__:     import sys _sys     _sys.stderr.write('running scipy source directory.\n')     del _sys else:     try:         scipy.__config__ import show show_config     except importerror:         msg = """error importing scipy: cannot import scipy while         being in scipy source directory; please exit scipy source         tree first, , relaunch python intepreter."""         raise importerror(msg) 

i'm not entirely sure problem here although seems erros being thrown because there problem scipy config file. possibly not being included in build process. i'm quite novice , hoping more experienced generating build using cxfreeze can shed light on this.

incidentally, scipy in use installed binaries here.

i have had same issue. added code setup.py generated cx_freeze:

import scipy includefiles_list=[] scipy_path = dirname(scipy.__file__) includefiles_list.append(scipy_path) 

then, used includefiles_list part of build_exe parameter:

build_options = dict(packages=[], include_files=includefiles_list)  setup(name="foo", options=dict(build_exe=build_options)) 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -