[Numpy-discussion] numpy.distutils problem with py2app/py2exe?

Zachary Pincus zachary.pincus@yale....
Sun Jun 29 00:28:52 CDT 2008

Hello all,

I've noticed that py2app and py2exe work strangely on my project,  
which (having fortran code) is driven by the numpy distutils. Now,  
these two distutils commands need to peek into the build/lib. 
[whatever] directories to grab the files to package up. Indeed, the  
docs for py2exe and py2app say that the build directories are  
automatically added to the path.

However, I found that for my project, I need to explicitly add lines  
to the setup.py file like:

if have_py2exe:
   sys.path.insert(0, './build/lib.win32-%d.%d'%(sys.version_info[0],  

I got around to digging a little deeper, and at least in the py2app  
case, py2app distutils Command subclass gets the build dir information  
as follows:

     def run(self):
         build = self.reinitialize_command('build')
         [... snip ...]
         extra_paths.extend([build.build_platlib, build.build_lib])

Now, when I run py2app, the build.build_platlib and build.build_lib  
values are None. So py2app never finds the library directory, and thus  
packages the files incorrectly. Is this likely to be (a) a problem in  
numpy.distutils, (b) a problem with my local setup, or (c) a problem  
with py2app?

Any thoughts?


More information about the Numpy-discussion mailing list