From: Werner <wer...@gm...> - 2015-03-17 15:40:49
|
Hi, On 3/14/2015 15:22, Terry Chia wrote: > Hi all, > > I am attempting to package a py2exe app that relies on a third party > dependency that has non .py files. In this case it is a .c/.h file that > gets compiled at build time. > > The .c/.h files is opened by a .py file with the following snippet. > > with open(os.path.join(os.path.dirname(__file__), "src/padding.h")) > as f: > > Everything works fine running Python normally but falls apart upon > py2exe packaging because the .c and .h files goes missing. I found some > documentation[0] that shows how to get arbitrary files packaged under > py2exe but that does not work if the non .py files are in the > dependencies instead of the project being packaged. > > Is there a solution to this? I am open to having changes being made to > the setup.py files of the dependencies if required. > > [0]: http://www.py2exe.org/index.cgi/AddingConfigFiles How are you adding these .h/.c files? It should work if you use the 'data_files' option shown in the link you give, but you might have to make sure the path you use in your code is correct. Werner |