Thanks again for your quick response, Martin.
I created simple test projects for numpy and OpenCV.
My numpy test is getnumpy.py:
import numpy
print numpy.vander.__doc__
I ran:
python pyinstaller.py ../src/getnumpy.py
and then ran getnumpy.exe. r1609 works where r1608 failed!
My test for OpenCV is getopencv.py:
import cv
print cv.Trace.__doc__ # print cv.trace.__doc__ in the case of
OpenCV 2.2
I tried this with both OpenCV 2.2 and 2.3. In both cases, the result
was something like:
PS C:\users\b\p\tst\d\pyinstaller-trunk-r1609> .\getopencv\dist
\getopencv\getopencv.exe
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 424, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 514, in doimport
exec co in mod.__dict__
File "C:\users\b\p\tst\d\pyinstaller-trunk-r1609\getopencv\build
\pyi.win32\getopencv\outPYZ1.pyz\cv", line 1, in <module>
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 424, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 493, in doimport
mod = director.getmod(nm)
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 285, in getmod
mod = owner.getmod(nm)
File "C:\Users\b\p\tst\d\pyinstaller-trunk-r1609\PyInstaller\iu.py",
line 94, in getmod
mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
ImportError: numpy.core.multiarray failed to import
PS C:\users\b\p\tst\d\pyinstaller-trunk-r1609>
The OpenCV "build process", if I can call it that as I'm doing it, is
a little kludgy. For OpenCV 2.3, I copy cv.py and cv2.pyd from C:
\OpenCV2.3\build\python\2.7 to C:\Python27\Lib\site-packages. But, I
can open Python and call:
import cv
print cv.Trace.__doc__
and it works, so PyInstaller may be at fault, here.
Brian
On Oct 4, 6:03 am, Martin Zibricky <[email protected]> wrote:
> Could you please try Pyinstaller r1609?
>
> If that works for you?
>
> Thanks in advance.
>
> Brian píše v Po 03. 10. 2011 v 16:22 -0700:
>
>
>
>
>
>
>
> > I've added "C:/Python27/Lib/site-packages/numpy" to the pathex of my
> > spec file, so the numpy pyd files appear in the dist directory, but
> > the “ImportError: numpy.core.multiarray failed to import” message
> > still appears. Is there something I can edit by hand just to get the
> > executable to recognize that the pyds are in the same directory?
>
> > On Oct 3, 1:13 pm, Brian <[email protected]> wrote:
> > > With PyInstaller 1.5, I was using the line
> > > import numpy.core.multiarray
> > > in my source to cause the numpy.core.multiarray.pyd to be copied into
> > > the dist folder for the sake of the OpenCV code that needed it.
>
> > > Now, with PyInstaller r1608, numpy.core.multiarray.pyd is still being
> > > copied, but the exception
> > > numpy.core.multiarray failed to import
> > > is being thrown.
>
> > > I created hook-numpy.py, with
> > > hiddenimports = ["numpy.core", "numpy.core.multiarray"]
> > > inside, but that failed to do the trick. There is no warnproject.txt
> > > file to be found.
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.