From: Massa, H. A. <ch...@gh...> - 2016-03-08 17:07:25
|
Hi Sharma, > Update: > My exe is running on computers which have Anaconda 2.7 64-bit version > installed on their computers. > > yes, because they have multiarray.pyd on their computer. You said: > 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. > which makes your error message rather suspicious. Anyway, multiarray.pyd is probably the binary file that is missing. Have you checked if it is copied into the build directory? pyexe builds an exe and a zip; or, if run in the single file mode, just an .exe. That .exe can be "unzipped" by using 7zip. That allows you to check: has multiarray.pyd be included? > > Also, could you please specify that how do I solve the problem using > solution b) by using my_toplevel_file_with_py2exepatches.py: and import > statements. > > IF the check (looking into build directory / checking what is zipped into your .exe / .zip by py2exe) confirms, that mutliarray.pyd is NOT packaged, we have to find a way to get in bundled. The tools used by py2exe aim to find all needed library feels by simulating the imports. As Python is more dynamic than anybody imagines; that may fail. A trick that often works is: explicitly import the file so, in your main script file, add the lines import numpy.core import numpy.core.mutliarray and after doing the setup.py build step, check if mutliarray.pyd is included in the build directory / the zipped up .exe file. best wishes Harald > Traceback (most recent call last): >> File "Moment_Final.py", line 5, in <module> >> File "matplotlib\__init__.pyc", line 122, in <module> >> File "matplotlib\cbook.pyc", line 33, in <module> >> File "numpy\__init__.pyc", line 180, in <module> >> File "numpy\add_newdocs.pyc", line 13, in <module> >> File "numpy\lib\__init__.pyc", line 8, in <module> >> File "numpy\lib\type_check.pyc", line 11, in <module> >> File "numpy\core\__init__.pyc", line 14, in <module> >> File "numpy\core\multiarray.pyc", line 12, in <module> >> File "numpy\core\multiarray.pyc", line 10, in __loadImportError: DLL load failed: The specified module could not be found. >> >> multiarray.py tries to import a file in line 10, most likely a .pyd > That .pyd is for some reasons not included in your distributed exe-file. > > To analyse the problem: > - read the file numpy\core\multiarray.py > - check which file is imported in line 10 > > After finding the name of the file, check your dist-directory if that .pyd > is really missing. > > If that .pyd is missing, you have 2 options: > > a) there is an include-directive in py2exe options; you can try to > explicitly name the .pyd to be included > b) I had good results by explicitly importing files which import .pyd on a > top level, that is > > my_toplevel_file_with_py2exepatches.py: > > import sys > import numpy.core > import numpy.core.multiarray > > More of these tricks you can find on http://py2exe.org/ > <http://py2exe.org/> > FrontPage - py2exe.org <http://py2exe.org/> > py2exe.org > py2exe. py2exe is a Python Distutils extension which converts Python > scripts into executable Windows programs, able to run without requiring a > Python installation. > > > Best wishes > > Harald > > > > > >> >> >> ------------------------------------------------------------------------------ >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://makebettercode.com/inteldaal-eval >> _______________________________________________ >> Py2exe-users mailing list >> Py2...@li... >> https://lists.sourceforge.net/lists/listinfo/py2exe-users >> >> > > > -- > > GHUM GmbH > Harald Armin Massa > Spielberger Straße 49 > 70435 Stuttgart > 0173/9409607 > > Amtsgericht Stuttgart, HRB 734971 > > -- GHUM GmbH Harald Armin Massa Spielberger Straße 49 70435 Stuttgart 0173/9409607 Amtsgericht Stuttgart, HRB 734971 |