DLL load failed: The specified module could not be found.

729 views
Skip to first unread message

hearan...@googlemail.com

unread,
Mar 10, 2009, 3:51:47 PM3/10/09
to PyInstaller
hi im trying to compile a simple scritp to a onefile exe:

upload.py
http://paste2.org/p/162074

and i get this error when i try to execute the file, or when i try to
upload a file trough the exe. no matter if --onefile is triggered
i have to say that as a .py script everything works fine. trying
py2exe works but i dont like it that way.


here is the error:
http://paste2.org/p/162077

Giovanni Bajo

unread,
Mar 10, 2009, 6:35:56 PM3/10/09
to PyIns...@googlegroups.com

It seems that you're using PyInstaller 1.3 which is very old right now
(try with a fresh checkout of trunk from SVN) and Python 2.6, which is
not yet fully supported.

It should perfectly work with PyInstaller trunk and Python 2.5, but I
can't help at the moment with Python 2.6.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


Message has been deleted

hearan...@googlemail.com

unread,
Mar 11, 2009, 5:39:53 AM3/11/09
to PyInstaller
ok i got it, it works now :D thank you very much!!

On 10 Mrz., 22:35, Giovanni Bajo <ra...@develer.com> wrote:

Stephen Dolan

unread,
Mar 11, 2009, 7:03:21 AM3/11/09
to PyIns...@googlegroups.com
2009/3/10 Giovanni Bajo <ra...@develer.com>:

>
> On mar, 2009-03-10 at 12:51 -0700, hearan...@googlemail.com wrote:
>> hi im trying to compile a simple scritp to a onefile exe:
[snip]

>
> It seems that you're using PyInstaller 1.3 which is very old right now
> (try with a fresh checkout of trunk from SVN) and Python 2.6, which is
> not yet fully supported.
>
> It should perfectly work with PyInstaller trunk and Python 2.5, but I
> can't help at the moment with Python 2.6.
> --
> Giovanni Bajo
> Develer S.r.l.
> http://www.develer.com

Hi Giovanni,

Sorry to hijack the thread, but I'm currently using pyinstaller on a
python2.5 based project. Its working great and thanks for all the
effort you've put into it. However, we're planning to move to python
2.6 in the near future, and I'm concerned to hear that it is not
supported. Do you plan to support 2.6 in the near future? Do you know
for sure that pyinstaller will not work with 2.6 ?

Thanks for your help,
Stephen

Giovanni Bajo

unread,
Mar 12, 2009, 7:46:56 AM3/12/09
to PyIns...@googlegroups.com
On Wed, 2009-03-11 at 11:03 +0000, Stephen Dolan wrote:
> Hi Giovanni,
>
> Sorry to hijack the thread, but I'm currently using pyinstaller on a
> python2.5 based project. Its working great and thanks for all the
> effort you've put into it. However, we're planning to move to python
> 2.6 in the near future, and I'm concerned to hear that it is not
> supported. Do you plan to support 2.6 in the near future? Do you know
> for sure that pyinstaller will not work with 2.6 ?

Hi Stephen,

I don't see any specific problem with PyInstaller and Python 2.6 on
Linux and the (upcoming) Mac support, but on Windows many things changed
because of the compiler switch and the way binaries are distributed
(with SxS). I can't say for sure whether it will work out of the box or
not, I did not even try.

Stephen Dolan

unread,
Mar 12, 2009, 7:49:24 AM3/12/09
to PyIns...@googlegroups.com
2009/3/12 Giovanni Bajo <ra...@develer.com>:

>
> Hi Stephen,
>
> I don't see any specific problem with PyInstaller and Python 2.6 on
> Linux and the (upcoming) Mac support, but on Windows many things changed
> because of the compiler switch and the way binaries are distributed
> (with SxS). I can't say for sure whether it will work out of the box or
> not, I did not even try.
> --
> Giovanni Bajo
> Develer S.r.l.
> http://www.develer.com
>

Well then, perhaps I will try it and I will let the list know how I
get on and if I have any issues.

Stephen

Florian Höch

unread,
Mar 12, 2009, 10:36:02 AM3/12/09
to PyInstaller
Yes, all the WinSxS stuff is quite confusing (atleast for me, not
having too much experience with it either). But I may be able to
provide some pointers, to get PyInstaller (latest trunk) to create
working exe's on Windows with Python 2.6 and maybe 2.6.1 (I might have
more info later)
You first need to apply the patches posted here
http://pyinstaller.python-hosting.com/attachment/ticket/39/PyInstaller-Tweaks.diff
(maybe sans the python26.dll exclusion, and you may need to apply them
manually since the trunk changed since the patches were posted).
Then, the method I currently use to get working executables with
Python 2.6 is:
- Get the MSVCRT 9 DLLs and accompanying manifest (they are for
example in \WINDOWS\WinSxS in a subfolder if you installed Python 2.6
via the official python.org Windows Installer)
- In the spec file look for the part that reads a.binaries and change
it to a.binaries + ['Microsoft.VC90.CRT.manifest', 'msvcm90.dll',
'msvcp90.dll', 'msvcr90.dll']
(copy the DLLs from WinSxS or add the full paths to the filenames)
- Now, the executable should be able to run if Python 2.6 was used to
create it.
- For Python 2.6.1, it still won't work - I will post again if I find
something new.

Giovanni Bajo

unread,
Mar 12, 2009, 5:52:09 PM3/12/09
to PyIns...@googlegroups.com
On gio, 2009-03-12 at 07:36 -0700, Florian Höch wrote:
> Yes, all the WinSxS stuff is quite confusing (atleast for me, not
> having too much experience with it either). But I may be able to
> provide some pointers, to get PyInstaller (latest trunk) to create
> working exe's on Windows with Python 2.6 and maybe 2.6.1 (I might have
> more info later)
> You first need to apply the patches posted here
> http://pyinstaller.python-hosting.com/attachment/ticket/39/PyInstaller-Tweaks.diff
> (maybe sans the python26.dll exclusion, and you may need to apply them
> manually since the trunk changed since the patches were posted).
> Then, the method I currently use to get working executables with
> Python 2.6 is:
> - Get the MSVCRT 9 DLLs and accompanying manifest (they are for
> example in \WINDOWS\WinSxS in a subfolder if you installed Python 2.6
> via the official python.org Windows Installer)
> - In the spec file look for the part that reads a.binaries and change
> it to a.binaries + ['Microsoft.VC90.CRT.manifest', 'msvcm90.dll',
> 'msvcp90.dll', 'msvcr90.dll']
> (copy the DLLs from WinSxS or add the full paths to the filenames)
> - Now, the executable should be able to run if Python 2.6 was used to
> create it.
> - For Python 2.6.1, it still won't work - I will post again if I find
> something new.

I am told that it should work if you copy the files into a directory
next to the executable with the same name it has within the \Windows
\WinSxS folder. I think it's called "Microsoft.VC90.CRT".

If so, try creating a structure like this:

YourProgram.exe <- made by PyInstaller
Microsoft.VC90.CRT\
msvcr90.dll
msvcp90.dll
etc.

Let me know if it works like this.

Florian Höch

unread,
Mar 13, 2009, 7:47:58 AM3/13/09
to PyInstaller
Thanks, now I found what I was missing - the executable also needs an
updated manifest which references the CRT. Then, it also works with
Python 2.6.1 (for Python 2.6 the changed manifest is not needed)
Summary so far for me:

- My method above: works with Python 2.6 (both --onedir and --
onefile), --onedir also works with Python 2.6.1, but not --onefile
- My method above + assembly next to the executable (DLLs +
Microsoft.VC90.CRT.manifest, either in subfolder called
Microsoft.VC90.CRT or loose files): --onefile also works with Python
2.6.1 (even though it is no longer really a onefile deployment - but I
certainly don't blame pyinstaller)

I also found this http://bugs.python.org/issue4566 I didn't know about
before - so maybe we can hope that a real fix for those issues will be
incorporated into Python itself in a next version.

Regards,

Florian Höch

On 12 Mrz., 22:52, Giovanni Bajo <ra...@develer.com> wrote:
> On gio, 2009-03-12 at 07:36 -0700, Florian Höch wrote:
>
>
>
> > Yes, all the WinSxS stuff is quite confusing (atleast for me, not
> > having too much experience with it either). But I may be able to
> > provide some pointers, to get PyInstaller (latest trunk) to create
> > working exe's on Windows with Python 2.6 and maybe 2.6.1 (I might have
> > more info later)
> > You first need to apply the patches posted here
> >http://pyinstaller.python-hosting.com/attachment/ticket/39/PyInstalle...

Florian Höch

unread,
Mar 13, 2009, 10:03:19 AM3/13/09
to PyInstaller
sorry, I just noticed some typos in my above post. the line in the
specfile should read:

a.binaries + [('Microsoft.VC90.CRT.manifest',
'Microsoft.VC90.CRT.manifest', 'BINARY'), ('msvcm90.dll',
'msvcm90.dll', 'BINARY'),
('msvcp90.dll', 'msvcp90.dll', 'BINARY'), ('msvcr90.dll',
'msvcr90.dll', 'BINARY')]

On 12 Mrz., 15:36, Florian Höch <florian.ho...@gmx.de> wrote:
> Yes, all the WinSxS stuff is quite confusing (atleast for me, not
> having too much experience with it either). But I may be able to
> provide some pointers, to get PyInstaller (latest trunk) to create
> working exe's on Windows with Python 2.6 and maybe 2.6.1 (I might have
> more info later)
> You first need to apply the patches posted herehttp://pyinstaller.python-hosting.com/attachment/ticket/39/PyInstalle...

Giovanni Bajo

unread,
Mar 14, 2009, 9:53:58 AM3/14/09
to PyIns...@googlegroups.com
On ven, 2009-03-13 at 04:47 -0700, Florian Höch wrote:
> Thanks, now I found what I was missing - the executable also needs an
> updated manifest which references the CRT. Then, it also works with
> Python 2.6.1 (for Python 2.6 the changed manifest is not needed)
> Summary so far for me:
>
> - My method above: works with Python 2.6 (both --onedir and --
> onefile), --onedir also works with Python 2.6.1, but not --onefile
> - My method above + assembly next to the executable (DLLs +
> Microsoft.VC90.CRT.manifest, either in subfolder called
> Microsoft.VC90.CRT or loose files): --onefile also works with Python
> 2.6.1 (even though it is no longer really a onefile deployment - but I
> certainly don't blame pyinstaller)
>
> I also found this http://bugs.python.org/issue4566 I didn't know about
> before - so maybe we can hope that a real fix for those issues will be
> incorporated into Python itself in a next version.

>From the reading of the bug, I deduce that the executable's manifest is
not required anymore in Python 2.6.2. This will leave Python 2.6.1 as
the only version requiring this workaround -- in which case, I prefer to
simply declare it unsupported and bail out when running Configure.py
against it.

On the other hand, I would like to incorporate your fixes for Python 2.6
but we need to find a better way of doing it.

First question: if you *don't* add the msvc*90.dll and the manifest to
the a.binaries list, but you simply copy them like this:

YourProgram.exe <- made by PyInstaller
Microsoft.VC90.CRT\
msvcr90.dll
msvcp90.dll
etc.

so *without* copying the manifest, does it work?

Florian Höch

unread,
Mar 14, 2009, 11:36:04 AM3/14/09
to PyInstaller
Yes, I agree that it doesn't make much sense to fix it in pyinstaller
if it's going to be fixed (hopefully ;)) in python itself anyway.

Regarding your question: No, unfortunately the manifest seems to be
needed, otherwise the exe will show an error popup right after launch
('application configuration incorrect') and close.

On 14 Mrz., 14:53, Giovanni Bajo <ra...@develer.com> wrote:
> On ven, 2009-03-13 at 04:47 -0700, Florian Höch wrote:
>
>
>
> > Thanks, now I found what I was missing - the executable also needs an
> > updated manifest which references the CRT. Then, it also works with
> > Python 2.6.1 (for Python 2.6 the changed manifest is not needed)
> > Summary so far for me:
>
> > - My method above: works with Python 2.6 (both --onedir and --
> > onefile), --onedir also works with Python 2.6.1, but not --onefile
> > - My method above + assembly next to the executable (DLLs +
> > Microsoft.VC90.CRT.manifest, either in subfolder called
> > Microsoft.VC90.CRT or loose files): --onefile also works with Python
> > 2.6.1 (even though it is no longer really a onefile deployment - but I
> > certainly don't blame pyinstaller)
>
> > I also found thishttp://bugs.python.org/issue4566I didn't know about
Message has been deleted

Florian Höch

unread,
Mar 17, 2009, 7:50:52 AM3/17/09
to PyInstaller
Just a quick update, I've started working on some patches which should
fix assembly dependencies on windows in general. I think I may be
ready in a few days. My current outline of changes:

- add manifest embedding/extraction support to pyinstaller
(manifest.py - provides UpdateManifest and GetManifest methods).
Status: 50% done.
- add general resource embedding/extraction support to pyinstaller
(resource.py - provides AddResource and GetResource methods, used by
manifest.py). Status: 50% done.
- add manifest query code to bindepend.py, to look inside binary
dependencies, extract the manifest if any, get the dependant
assemblies if any by looking at the manifest and searching for the
assembly in WinSxS folder, then adding the assembly files as BINARY.
Status: just started working on it.

On 14 Mrz., 16:36, Florian Höch <florian.ho...@gmx.de> wrote:
> Yes, I agree that it doesn't make much sense to fix it in pyinstaller
> if it's going to be fixed (hopefully ;)) in python itself anyway.
>
> Regarding your question: No, unfortunately the manifest seems to be
> needed, otherwise the exe will show an error popup right after launch
> ('application configuration incorrect') and close.
>
> On 14 Mrz., 14:53, Giovanni Bajo <ra...@develer.com> wrote:
>
> > On ven, 2009-03-13 at 04:47 -0700, Florian Höch wrote:
>
> > > Thanks, now I found what I was missing - the executable also needs an
> > > updated manifest which references the CRT. Then, it also works with
> > > Python 2.6.1 (for Python 2.6 the changed manifest is not needed)
> > > Summary so far for me:
>
> > > - My method above: works with Python 2.6 (both --onedir and --
> > > onefile), --onedir also works with Python 2.6.1, but not --onefile
> > > - My method above + assembly next to the executable (DLLs +
> > > Microsoft.VC90.CRT.manifest, either in subfolder called
> > > Microsoft.VC90.CRT or loose files): --onefile also works with Python
> > > 2.6.1 (even though it is no longer really a onefile deployment - but I
> > > certainly don't blame pyinstaller)
>
> > > I also found thishttp://bugs.python.org/issue4566Ididn't know about

Giovanni Bajo

unread,
Mar 17, 2009, 8:57:08 AM3/17/09
to PyIns...@googlegroups.com
On 3/17/2009 12:50 PM, Florian Höch wrote:
> Just a quick update, I've started working on some patches which should
> fix assembly dependencies on windows in general. I think I may be
> ready in a few days. My current outline of changes:
>
> - add manifest embedding/extraction support to pyinstaller
> (manifest.py - provides UpdateManifest and GetManifest methods).
> Status: 50% done.
> - add general resource embedding/extraction support to pyinstaller
> (resource.py - provides AddResource and GetResource methods, used by
> manifest.py). Status: 50% done.
> - add manifest query code to bindepend.py, to look inside binary
> dependencies, extract the manifest if any, get the dependant
> assemblies if any by looking at the manifest and searching for the
> assembly in WinSxS folder, then adding the assembly files as BINARY.
> Status: just started working on it.

Well, this seems GREAT progress.

Let me know if you want commit access to PyInstaller's SVN so that you
can develop it directly there.

Florian Höch

unread,
Mar 19, 2009, 5:29:59 PM3/19/09
to PyInstaller
Thanks for the kind offer, but let's see if I can get my patch out for
some users to test on the weekend :)
What I currently have seems to be working nice (tested with Python 2.5
and 2.6) on my WinXP sys (and also the Windows 7 Beta, still need to
check Vista).

Florian Höch

unread,
Mar 21, 2009, 12:48:06 PM3/21/09
to PyInstaller
Ok, I've added my patch to the existing ticket here
http://pyinstaller.python-hosting.com/ticket/39 because it also
incorporates jkp's original patch.
It would be great if some users could test it :)
Reply all
Reply to author
Forward
0 new messages