I am trying to make an executable with python, py2exe using Enthought. The program.py starts with:
import pandas as pd
import pyper as pr
r=pr.R(use_pandas=True)
The setup.py is as below:
from distutils.core import setup
import py2exe
import matplotlib
import sys
opts={"py2exe":{"bundle_files"}}
sys.argv.append('py2exe')
opts = {'py2exe': {"bundle_files" : 3, "includes" : [ "matplotlib.backends", "matplotlib.backends.backend_qt4agg", "pylab","numpy", "matplotlib.backends.backend_tkagg"], 'excludes':['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg', '_fltkagg', '_gtk', '_gtkcairo'], 'dll_excludes': ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll']}}
setup(console=['program.py'],zipfile=None,options=opts,data_files=matplotlib.get_py2exe_datafiles())
After running:python setup.py py2exe
the two folders dist and build were created. But when launched program.exe I got this:
Dll load failed: The specified module could not be found
Traceback (most recent call last):
File "program.py", line 1, in module
File "pandas\__init__.pyc", line 6, in module
File "pandas\hashtable.pyc", line 12, in module
File "pandas\hashtable.pyc", line 10, in module
File "numpy.pxd.", line 157, in init pandas.hastable (pandas\hastable.c:19547)
File "numpy\__init__.pyc", line 143, in module
File "numpy\lib\add_newdocs.pyc", line 9, in module
File "numpy\lib\__init__.pyc", line 13, in module
File "numpy\lib\polynomial.pyc", line 17, in module
File "numpy\linalg\__init__.pyc", line 48, in module
File "numpy\linalg\linalg.pyc", line 23, in module
File "numpy\linalg\lapack_lite.pyc", line 12, in module
File "numpy\linalg\lapack_lite.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found**
I'm using Canopy 1.1.0 with Pandas 0.12.0-2 on a 64-Windows 7
Thanks for any help.
matplotlib.backends.backend_qt4agg
opts = {'py2exe': {"bundle_files" : 3, "includes" : [ "matplotlib.backends", "matplotlib.backends.backend_qt4agg",...
Aside from that don't you need to includenumpy
andpandas
? – Mullins"matplotlib.backends.backend_qt4agg"
.pandas
was used becauseprogram.py
imports a csv file as dataframe. – Detribalize