4

I am trying to compile a python script as a standalone application using Pyinstaller. The problem is that the process hangs while performing the operation:

Adding redirect Microsoft.VC90.MFC

This is the full output. I am running python 2.7 under Windows through Conda.

C:\Users\Jesucristo\Desktop\qt_compiled\pyqt4>pyinstaller --onefile --windowed
interactiveMPL_app.py
279 INFO: PyInstaller: 3.2
279 INFO: Python: 2.7.12
280 INFO: Platform: Windows-7-6.1.7601-SP1
282 INFO: wrote C:\Users\Jesucristo\Desktop\qt_compiled\pyqt4\interactiveMPL_app
.spec
287 INFO: UPX is not available.
292 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Jesucristo\\Desktop\\qt_compiled\\pyqt4',
 'C:\\Users\\Jesucristo\\Desktop\\qt_compiled\\pyqt4']
292 INFO: checking Analysis
292 INFO: Building Analysis because out00-Analysis.toc is non existent
292 INFO: Initializing module dependency graph...
298 INFO: Initializing module graph hooks...
371 INFO: running Analysis out00-Analysis.toc
378 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by c:\users\jesucristo\miniconda2\python.exe
536 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
539 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
540 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
542 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
542 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
694 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.3
0729.6161_none ...
696 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251.manifest
698 INFO: Searching for file msvcr90.dll
698 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6161_none_08e61857a83bc251\msvcr90.dll
700 INFO: Searching for file msvcp90.dll
700 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6161_none_08e61857a83bc251\msvcp90.dll
700 INFO: Searching for file msvcm90.dll
700 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6161_none_08e61857a83bc251\msvcm90.dll
846 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
851 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
852 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
854 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
855 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
858 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,
30729, 6161)
7844 INFO: Caching module hooks...
7851 INFO: Analyzing C:\Users\Jesucristo\Desktop\qt_compiled\pyqt4\interactiveMP
L_app.py
9783 INFO: Processing pre-find module path hook   distutils
16548 INFO: Processing pre-safe import module hook   _xmlplus
16782 INFO: Processing pre-safe import module hook   win32com
17786 INFO: Processing pre-find module path hook   site
17803 INFO: site: retargeting to fake-dir 'C:\\Users\\Jesucristo\\Miniconda2\\Li
b\\site-packages\\PyInstaller\\fake-modules'
20504 INFO: Processing pre-safe import module hook   six.moves
27915 INFO: Processing pre-find module path hook   PyQt5.uic.port_v3
27944 INFO: Processing pre-find module path hook   PyQt5.uic.port_v2
28759 INFO: Loading module hooks...
28760 INFO: Loading module hook "hook-distutils.py"...
28782 INFO: Loading module hook "hook-sysconfig.py"...
28799 INFO: Loading module hook "hook-xml.py"...
28800 INFO: Loading module hook "hook-scipy.sparse.csgraph.py"...
28808 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
28810 INFO: Loading module hook "hook-httplib.py"...
28812 INFO: Loading module hook "hook-pydoc.py"...
28839 INFO: Excluding import 'Tkinter'
28844 WARNING:   Removing import pydoc from module Tkinter
28845 INFO: Loading module hook "hook-PyQt5.uic.py"...
28871 INFO: Loading module hook "hook-PyQt5.py"...
28894 INFO: Loading module hook "hook-_tkinter.py"...
30312 INFO: checking Tree
30312 INFO: Building Tree because out00-Tree.toc is non existent
30313 INFO: Building Tree out00-Tree.toc
30986 INFO: checking Tree
30986 INFO: Building Tree because out01-Tree.toc is non existent
30986 INFO: Building Tree out01-Tree.toc
31052 INFO: Loading module hook "hook-matplotlib.backends.py"...
32211 INFO:   Matplotlib backend "GTK": ignored
    Gtk* backend requires pygtk to be installed.
33210 INFO:   Matplotlib backend "GTKAgg": ignored
    Gtk* backend requires pygtk to be installed.
33825 INFO:   Matplotlib backend "GTKCairo": ignored
    No module named gtk
34648 INFO:   Matplotlib backend "MacOSX": ignored
    cannot import name _macosx
35618 INFO:   Matplotlib backend "Qt4Agg": added
36565 INFO:   Matplotlib backend "Qt5Agg": added
37374 INFO:   Matplotlib backend "TkAgg": added
38253 INFO:   Matplotlib backend "WX": ignored
    Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
39164 INFO:   Matplotlib backend "WXAgg": ignored
    Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
39776 INFO:   Matplotlib backend "GTK3Cairo": ignored
    Gtk3 backend requires pygobject to be installed.
40595 INFO:   Matplotlib backend "GTK3Agg": ignored
    Gtk3 backend requires pygobject to be installed.
41157 INFO:   Matplotlib backend "WebAgg": ignored
    Traceback (most recent call last):
  File "<string>", line 12, in <module>
  File "C:\Users\Jesucristo\Miniconda2\Lib\site-packages\matplotlib\backends\bac
kend_webagg.py", line 30, in <module>
    raise RuntimeError("The WebAgg backend requires Tornado.")
RuntimeError: The WebAgg backend requires Tornado.
41739 INFO:   Matplotlib backend "nbAgg": ignored
    No module named tornado.ioloop
42617 INFO:   Matplotlib backend "agg": added
43181 INFO:   Matplotlib backend "cairo": ignored
    Cairo backend requires that cairocffi or pycairo is installed.
43736 INFO:   Matplotlib backend "emf": ignored
    No module named backend_emf
44356 INFO:   Matplotlib backend "gdk": ignored
    No module named gobject
45220 INFO:   Matplotlib backend "pdf": added
46431 INFO:   Matplotlib backend "pgf": added
47300 INFO:   Matplotlib backend "ps": added
48193 INFO:   Matplotlib backend "svg": added
49128 INFO:   Matplotlib backend "template": added
49469 INFO: Loading module hook "hook-matplotlib.py"...
50112 INFO: Loading module hook "hook-pkg_resources.py"...
50115 INFO: Loading module hook "hook-scipy.linalg.py"...
50118 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
50254 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
51132 INFO: Loading module hook "hook-pytz.py"...
51417 INFO: Loading module hook "hook-pywintypes.py"...
51724 INFO: Loading module hook "hook-setuptools.py"...
51743 INFO: Loading module hook "hook-scipy.special._ellip_harm_2.py"...
52835 INFO: Loading module hook "hook-PyQt5.Qt.py"...
52851 INFO: Loading module hook "hook-encodings.py"...
53598 INFO: Loading module hook "hook-scipy.special._ufuncs.py"...
53618 INFO: Loading module hook "hook-win32com.py"...
53787 INFO: Loading module hook "hook-pythoncom.py"...
54121 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
54401 INFO: Looking for ctypes DLLs
54447 INFO: Analyzing run-time hooks ...
54470 INFO: Including run-time hook 'pyi_rth_pkgres.py'
54476 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
54479 INFO: Including run-time hook 'pyi_rth_qt5.py'
54480 INFO: Including run-time hook 'pyi_rth_qt5plugins.py'
54483 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
54484 INFO: Including run-time hook 'pyi_rth_mpldata.py'
54529 INFO: Looking for dynamic libraries
150553 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.1_none_3624aa14c1dce505.manifest
150571 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.4148_none_a551ff35e6a96bed.manifest
150572 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.6161_none_a554a30de6a6e582.manifest
150723 INFO: Searching for assembly amd64_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.
0.30729.6161_none ...
150724 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.mfc
_1fc8b3b9a1e18e3b_9.0.30729.6161_none_044aad0bab1eb146.manifest
150727 INFO: Searching for file mfc90.dll
150727 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18
e3b_9.0.30729.6161_none_044aad0bab1eb146\mfc90.dll
150729 INFO: Searching for file mfc90u.dll
150729 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18
e3b_9.0.30729.6161_none_044aad0bab1eb146\mfc90u.dll
150730 INFO: Searching for file mfcm90.dll
150730 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18
e3b_9.0.30729.6161_none_044aad0bab1eb146\mfcm90.dll
150730 INFO: Searching for file mfcm90u.dll
150730 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18
e3b_9.0.30729.6161_none_044aad0bab1eb146\mfcm90u.dll
150879 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.1_none_3624aa14c1dce505.manifest
150881 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.4148_none_a551ff35e6a96bed.manifest
150882 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.m
fc_1fc8b3b9a1e18e3b_9.0.30729.6161_none_a554a30de6a6e582.manifest
150884 INFO: Adding redirect Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9,
0, 30729, 6161)
Tomas Ruiz
  • 150
  • 2
  • 14
  • I thought I had the same problem but it turned out that I was being impatient. I inadvertently left the window open and ten minutes later I noticed the conversion was complete. Try leaving it longer...? – jgrant Nov 04 '16 at 01:55
  • @jgrant You are right. It takes about 30 minutes to complete the 'Adding redirect Microsoft.VC90.MFC...' step. Post it as an answer an I will accept it. – Tomas Ruiz Nov 04 '16 at 12:57
  • Also, I wonder why it takes so long. I usually need several tries until the .exe compiles properly. Waiting half hour every try is really annoying. – Tomas Ruiz Nov 04 '16 at 13:00
  • FWIW, with 32bit python 2.7.4 and current pyinstaller develop I don't get a hang, but a file not found for %appdata% `\Roaming\pyinstaller\\bincache01_py27_32bit\\msvcr90.dll`. Curiously on the same machine running 64bit python with the same .spec file works. – matt wilkie Mar 20 '17 at 04:49

1 Answers1

3

Downgrading pyinstaller v3.2 to v3.1 works for me. Try pip install -Iv pyinstaller==3.1 then build your .exe again

Nguyen Kien
  • 186
  • 4
  • Thats true. Upgrading to development version fixes the problem as well. Moreover, it fixes other problems I had with missing dlls and the windows runtime library. – Tomas Ruiz Nov 21 '16 at 15:52
  • How to upgrade to development version? – janscas Nov 30 '16 at 10:03
  • @janscas `pip install git+https://github.com/pyinstaller/pyinstaller.git` – Tomas Ruiz Dec 18 '16 at 00:17
  • @JabbaTheHut do you happen to know of a way to get the development install done on Windows? – codeAndStuff Dec 21 '16 at 20:35
  • 1
    @MaxGraves you can use the 'pip' command as in linux (see my previous comment). If you don't have pip installed, follow this : [http://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows]. If you prefer, you can download it from [https://github.com/pyinstaller/pyinstaller.git ] and install it with `python setup.py install` – Tomas Ruiz Dec 22 '16 at 07:40
  • @JabbaTheHut Thanks for the quick reply - I do have pip installed and use it to manage most of my Python packages on windows. It's the 'git' that doesn't work properly even though I have git and the executable is on the path. I'll try the setup.py way. Ugh, Windows - if only Apt was available for every platform – codeAndStuff Dec 22 '16 at 13:59
  • 1
    @MaxGraves Here you go, buried deep inside wiki for pyinstaller: `pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip` – Nguyen Kien Jan 03 '17 at 16:09