Runtime Error when launch onefile executable, prepared with PyInstaller 2.1

527 views
Skip to first unread message

Sergey

unread,
Dec 31, 2013, 12:19:31 PM12/31/13
to pyins...@googlegroups.com
When I launch onefile executable, prepared with PyInstaller 2.1, I get error:

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: ..\MyProgram.exe

R6034

An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.


---------------------------
ОК  
---------------------------

If put these files into folder with onefile executable MyProgram.exe, everything is working:

mfc90.dll
Microsoft.VC90.CRT.manifest
Microsoft.VC90.MFC.manifest
msvcm90.dll
msvcp90.dll
msvcr90.dll
MyProgram.exe.manifest
----------------------------

dumpbin /DEPENDENTS MyProgram.exe

Dump of file MyProgram.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    USER32.dll
    KERNEL32.dll
    WS2_32.dll

  Summary

        B000 .data
        7000 .rdata
       18000 .rsrc
       1B000 .text
-----------------
MyProgram.exe contains no manifest inside its resources.

When I see error message, there is folder _MEI14362 in windows Temp directory.
It contains all these files:mfc90.dll
Microsoft.VC90.CRT.manifest
Microsoft.VC90.MFC.manifest
msvcm90.dll
msvcp90.dll
msvcr90.dll
MyProgram.exe.manifest
, but windows does not see them.
Only copying to the folder with onefile executable helps.

Please help me. How to make onefile executable working without mfc and crt dll files in the same folder with it?

 

Martin Zibricky

unread,
Jan 2, 2014, 6:02:10 PM1/2/14
to pyins...@googlegroups.com
On Tuesday 31 of December 2013 09:19:31 Sergey wrote:
> Please help me. How to make onefile executable working without mfc and crt
> dll files in the same folder with it?

What is your windows version?


signature.asc

Martin Zibricky

unread,
Jan 3, 2014, 6:02:16 AM1/3/14
to pyins...@googlegroups.com
On Tuesday 31 of December 2013 09:19:31 Sergey wrote:
> Please help me. How to make onefile executable working without mfc and crt
> dll files in the same folder with it?

Do you use any server edition of Windows?

Manifest files are there handled differently than on non server edition.
signature.asc

Sergey

unread,
Jan 3, 2014, 12:35:36 PM1/3/14
to pyins...@googlegroups.com
I test on Windows 7 Professional 64bit.

Sergey

unread,
Jan 3, 2014, 12:57:26 PM1/3/14
to pyins...@googlegroups.com
Same problem on WindowsXP.
I've found out that problem appears only if I use numpy module in my python program:
import numpy

If do not import numpy, executable is launching well without additional files.

Sergey

unread,
Jan 3, 2014, 1:41:55 PM1/3/14
to pyins...@googlegroups.com
I've prepared test example, demonstrating the problem:
https://www.dropbox.com/s/7lz1e30stap892l/pyInstaller.zip

dist\MyProgram.exe - executable, fails to run

if comment out line in main.py:
import numpy
and launch build.bat, new executable will be created, which is launching well (without numpy included)

Martin Zibricky

unread,
Jan 3, 2014, 2:28:35 PM1/3/14
to pyins...@googlegroups.com
On Friday 03 of January 2014 09:57:26 Sergey wrote:
> If do not import numpy, executable is launching well without additional
> files.

Could you provide more details about your python version and how did you
install numpy?
signature.asc

Sergey

unread,
Jan 5, 2014, 5:38:41 AM1/5/14
to pyins...@googlegroups.com
I use Python 2.7.2

I've tried both methods:

pip install numpy

and

download/install http://sourceforge.net/projects/numpy/files/latest/download

- in both cases I get error, when launching onefile executable.

Martin Zibricky

unread,
Jan 6, 2014, 5:43:40 PM1/6/14
to pyins...@googlegroups.com
In both cases you were trying to install the source code.

Numpy contains binary extensions and for windows you need to download
andinstall the superpack file:

numpy-1.8.0-win32-superpack
signature.asc

Sergey

unread,
Jan 8, 2014, 10:38:25 AM1/8/14
to pyins...@googlegroups.com

Martin Zibricky

unread,
Jan 10, 2014, 12:35:29 PM1/10/14
to pyins...@googlegroups.com
On Wednesday 08 of January 2014 07:38:25 Sergey wrote:
> When I open url http://sourceforge.net/projects/numpy/files/latest/download
> it redirects me to
> http://downloads.sourceforge.net/project/numpy/NumPy/1.8.0/numpy-1.8.0-win32
> -superpack-python2.7.exe It is binary package.
> But I get onefile executable error anyway.

I tried today example

'import numpy'

as onefile on win7 with numpy superpack 1.8 and my fork works.

Could you try my fork, I did there some changes today.

https://github.com/matysek/pyinstaller
signature.asc

Sergey

unread,
Jan 11, 2014, 4:55:47 PM1/11/14
to pyins...@googlegroups.com
It didn't work on my WinXP machine also.
BUT when I setup build environment on the other Win7 machine (python 2.7.6), both development and standard pyInstaller versions give working executable.
For some reason on my WinXP machine with python 2.7.2 pyInstaller produces non-working executable.
I can see the difference in found vc assemblies.
pyInstaller searches for them and finds different ones on different machines.
Is there a way to control paths, where pyinstaller searches for assemblies/crt/mfc?

пятница, 10 января 2014 г., 21:35:29 UTC+4 пользователь Martin Z написал:

Martin Zibricky

unread,
Jan 11, 2014, 5:19:42 PM1/11/14
to pyins...@googlegroups.com
On Saturday 11 of January 2014 13:55:47 Sergey wrote:
> I can see the difference in found vc assemblies.
> pyInstaller searches for them and finds different ones on different
> machines.

Could you provide mor info about the difference?

Do you think this isssue is similar to yours?

http://www.pyinstaller.org/ticket/827

> Is there a way to control paths, where pyinstaller searches for
> assemblies/crt/mfc?

There is not much to control. You will have to look into source code.

I'm not even sure how this code part works. But as start you could look at

PyInstaller/bindepend.py: def getAssemblies(pth)
PyInstaller/utils/winmanifest.py




signature.asc

Sergey

unread,
Jan 11, 2014, 5:29:38 PM1/11/14
to pyins...@googlegroups.com
I made experiment - copied folder with installed python27 from winxp machine to win7 machine - and same python installation produced good onefile executable.
And vice versa - if copy working python installation from win7 machine to winxp machine - on winxp it produces bad executable.
Everything is the same except assemblies - on winxp I have VC2005,2008,2010 installed with a lot of patches.
Win7 does not have installed Visual Studio and pyInstaller takes mfc dlls from site-packages\Pythonwin.

Martin Zibricky

unread,
Jan 12, 2014, 6:51:15 PM1/12/14
to pyins...@googlegroups.com
What do you suggest to do?
signature.asc

Sergey

unread,
Jan 14, 2014, 1:46:47 AM1/14/14
to pyins...@googlegroups.com
I've fixed problem by reinstalling pywin32:

call activate.bat
pip uninstall pywin32
easy_install pywin32-218.win32-py2.7.exe

After this onefile, prepared on WinXP, launching well.
pywin32-218.win32-py2.7.exe replaces files in Windows directory.
Perhaps I had older version, which was not compartible with new pyInstaller.
Reply all
Reply to author
Forward
0 new messages