Daniel McQuillen <daniel@...83...> writes:
Charlie Moad <cwmoad <at> ...> writes:
>
> I just committed the changes to cvs and added a convenience function
> for py2exe called get_py2exe_datafiles.
Charlie,
Thanks for your help. I tried running your script and got an error originating
from the function you wrote within __init__.py. I tried the function by itself
within PyShell and got the same error...here's the error I received:
File "setup.py", line 23, in ?
data_files = [('', ['nlo.gif', '../vtkrotate/NMA.pdb']),
File "C:\Python24\Lib\site-packages\matplotlib\__init__.py", line 367, in get_
py2exe_datafiles
mplfiles = glob.glob(os.sep.join([matplotlib.get_data_path(), '*']))
NameError: global name 'matplotlib' is not defined
This seems to be the code that you added to the __init__.py file:
def get_py2exe_datafiles():
import glob
mplfiles = glob.glob(os.sep.join([matplotlib.get_data_path(), '*']))
# Need to explicitly remove cocoa_agg files or py2exe complains
mplfiles.remove(os.sep.join([matplotlib.get_data_path(), 'Matplotlib.nib']))
return ('matplotlibdata', mplfiles)
I removed the matplotlib references and the code then worked:
def get_py2exe_datafiles():
import glob
mplfiles = glob.glob(os.sep.join([get_data_path(), '*']))
# Need to explicitly remove cocoa_agg files or py2exe complains
mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
return ('matplotlibdata', mplfiles)
I can now create an .exe. I'll post soon as to how well the .exe actually works.
Thanks for your help.
Daniel
Oakland, CA