From: Jeremy K. <jer...@gm...> - 2016-03-09 00:37:08
|
On Tue, Mar 8, 2016 at 11:22 AM, Sharma, Girish <gir...@wu...> wrote: > Dear Massa, > > I understood what you are saying. Thank you for explaining it more clearly > to a newbie. > > To analyse the problem: > - read the file numpy\core\multiarray.py > - check which file is imported in line 10 > > But, > I could not find numpy\core\multiarray.py file in > C:\Anaconda2\Lib\site-packages\numpy\core. Though I found multiarray.pyd > file which I cannot open and see. multiarray.py is a stub file generated by py2exe for loading multiarray.pyd. It will not be found in the normal Python module locations. > which makes your error message rather suspicious. Anyway, multiarray.pyd is > probably the binary file that is missing. Actually, in this case it is a module that is imported *by* multiarray that is missing. > Have you checked if it is copied into the build directory? > > > Build directory has numpy\core\multiarray.pyc file. > Dist directory has numpy\core\multiarray.pyd file. > > import sys > import numpy.core > import numpy.core.mutliarray > As I alluded to above, the multiarray module does imports in C which py2exe cannot discover. The missing import is 'datetime' from the Python standard library. The "trick" used for adding missing modules to py2exe-generated executables is to add an: if 0: import missing_module_1 import missing_module_2 to the main executable that is scanned by the py2exe setup.py. For you, it should be sufficient to add "import datetime" to the forced import block: if 0: import datetime and regenerate the executable. -- Jeremy Kloth |