[Numpy-discussion] Py2exe / numpy troubles

tristan CORCELLE tcorcelle at yahoo.fr
Tue Aug 29 17:57:59 EDT 2006


> >1) First Problem: numpy\core\_internal.pyc not included in Library.zip
> 
>C:\Lameness\dist>templatewindow.exe
> Traceback (most recent call last):
>   File "templatewindow.py", line 7, in ?
>   File "wxmpl.pyc", line 25, in ?
>   File "matplotlib\numerix\__init__.pyc", line 60, in ?
>   File "Numeric.pyc", line 91, in ?
>   File "numpy\__init__.pyc", line 35, in ?
>   File "numpy\core\__init__.pyc", line 6, in ?
>   File "numpy\core\umath.pyc", line 12, in ?
>   File "numpy\core\umath.pyc", line 10, in __load
> AttributeError: 'module' object has no attribute '_ARRAY_API'
> 
> 
> 
> >I resolved that issue by adding the file
> >...\Python24\Lib\site-packages\numpy\core\_internal.pyc in
> >...\test\dist\library.zip\numpy\core.
> >Each time I compile that executable, I add the file by hand.
> >Does anybody know how to automatically add that file?
> 
> although mine was in \python23 respectively :)
> 
> thanks for this fix
> now i have this problem
> 
> C:\Lameness\dist>templatewindow.exe
> Traceback (most recent call last):
>   File "c:\python23\lib\site-packages\py2exe\boot_common.py", line 92, in ?
>     import linecache
> ImportError: No module named linecache
> Traceback (most recent call last):
>   File "templatewindow.py", line 1, in ?
> ImportError: No module named wx
> 
> C:\Lameness\dist>
> 
> 
> current setup.py =
> 
> ########################################################
> from distutils.filelist import findall
> import os
> import matplotlib
> matplotlibdatadir = matplotlib.get_data_path()
> matplotlibdata = findall(matplotlibdatadir)
> matplotlibdata_files = []
> for f in matplotlibdata:
>     dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:])
>     matplotlibdata_files.append((os.path.split(dirname)[0], [f]))
> 
> 
> packages = ['matplotlib', 'pytz']
> includes = []
> excludes = []
> dll_excludes = ['libgdk_pixbuf-2.0-0.dll',
>                 'libgobject-2.0-0.dll',
>                 'libgdk-win32-2.0-0.dll',
>                 'wxmsw26uh_vc.dll']
> 
> 
> opts = { 'py2exe': { 'packages' : packages,
>                      'includes' : includes,
>                      'excludes' : excludes,
>                      'dll_excludes' : dll_excludes
>                     }
>          }
> 
> setup ( console=['templatewindow.py'],
>         options = opts,
>         data_files = matplotlibdata_files
>         )
> ##########################################################
> 
> anyone seen this problem before?
> 
> first line of template window = import wx
>
My Configuration : Windows XP pro, ActivePython 2.4.2.10, Scipy 0.4.9, Numpy 0.9.8, MatplotLib 0.87.1, Py2exe 0.6.5, WxPython 2.6 ---- 1) Be very careful on how you generate the file "...\dist\library.zip".I don't know why, but the zip file generated by hand doesn't work. Check its size! Specific zip format? Specific options to generate it? I didn't check source files to know how library.zip is generated.My method is the following one:    - Extract the ...\test\dist\library.zip file in ...\test\dist\library    - Add the file ...\Python24\Lib\site-packages\numpy\core\_internal.pyc in ...\test\dist\library\numpy\core.    - Use Winzip to Add the ...\test\dist\library\numpy directory to the ...\dist\library.zip fileI know, it is not really beautiful but it seems to work. It is a temporary solution for debug. I am new in Python so my style is not really "academic" ---- 2) If you use my setup.py file, one more time, be careful cause of the wx specific dll: wxmsw26uh_vc.dllI don't
 know why, but Py2Exe doesn't find it. I remove that dll from the compilation phase and I copy it by hand in ...\test\dist directory.An idea may be the modification of setup.py file to indicate the path of that dll or something like that.DOES ANYONE HAVE THE SOLUTION?  ---- 3)I am still blocked on my second issue > >2) Second problem: I don't know how to resolve that issue:> > > >Traceback (most recent call last):> >  File "profiler_ftt.py", line 15, in ?> >    from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\> >  File "matplotlib\backends\backend_wx.pyc", line 152, in ?> >  File "matplotlib\backend_bases.pyc", line 10, in ?> >  File "matplotlib\colors.pyc", line 33, in ?> >  File "matplotlib\numerix\__init__.pyc", line 67, in ?> >  File "numpy\__init__.pyc", line 35, in ?> >  File "numpy\_import_tools.pyc", line 173, in __call__> >  File "numpy\_import_tools.pyc", line 68, in _init_info_modules> >  File "<string>", line 1, in ?> >  File
 "numpy\random\__init__.pyc", line 3, in ?> >  File "numpy\random\mtrand.pyc", line 12, in ?> >  File "numpy\random\mtrand.pyc", line 10, in __load> >  File "numpy.pxi", line 32, in mtrand> >AttributeError: 'module' object has no attribute 'dtype'> > > >I don't find the file numpy.pxi in my file tree nor in \test\dist\library.zip.> >I browsed the web in the hope to find a solution but nothing.> >It seems that this issue is well known but no solution provided in mailing lists.> > > >What is that file  "numpix.pxi"? Where to find it or how is it generated?> >How to resolve that execution issue? Regards,Tristan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060829/08fd5062/attachment-0001.html>


More information about the NumPy-Discussion mailing list