0

I'm building a simple program in Python that creates a bar chart. Since further I want to build a more complicated version, that will be used in other PC (where there is no python installed), I need to create a .exe. In order to create the executable, I'm using pyinstaller. Pyinstaller seems to work without any problem and creates the executable. But, when I run it, I got the following error:

Traceback (most recent call last):
File "PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in <module>
File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\loader\pyimod03_importers.py", line   389, in load_module exec(bytecode, module.__dict__)
File "pkg_resources\__init__.py", line 68, in <module>
File "pkg_resources\extern\__init__.py", line 60, in load_module
ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.Failed to execute script pyi_rth_pkgres

Do you guys have any idea how to solve it? Here the sourcecode:

import matplotlib.pyplot as plt

A = [5., 30., 45., 22.]
B = [5., 25., 50., 20.]
X = range(4)
plt.bar(X, A, color = 'b')
plt.bar(X,B, color = 'r', bottom = A)
plt.show()

and here the output log of pyinstaller:

223 INFO: PyInstaller: 3.2
223 INFO: Python: 3.5.2
223 INFO: Platform: Windows-7-6.1.7601-SP1
226 INFO: wrote C:\Users\310251823\PycharmProjects\Prove1\Prova.spec
243 INFO: UPX is not available.
251 INFO: Extending PYTHONPATH with paths
['C:\\Users\\310251823\\PycharmProjects\\Prove1',
 'C:\\Users\\310251823\\PycharmProjects\\Prove1']
251 INFO: checking Analysis
252 INFO: Building Analysis because out00-Analysis.toc is non existent
252 INFO: Initializing module dependency graph...
255 INFO: Initializing module graph hooks...
256 INFO: Analyzing base_library.zip ...
4572 INFO: running Analysis out00-Analysis.toc
4646 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-stdio-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
4652 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-heap-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
4657 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-locale-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
4689 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-math-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
4703 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-runtime-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5129 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-time-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5134 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-conio-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5160 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-string-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5169 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-process-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5186 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-convert-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5190 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-environment-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5203 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-filesystem-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
5207 INFO: Caching module hooks...
5213 INFO: Analyzing C:\Users\310251823\PycharmProjects\Prove1\Prova.py
5471 INFO: Processing pre-find module path hook   distutils
10751 INFO: Processing pre-find module path hook   site
10752 INFO: site: retargeting to fake-dir 'C:\\Users\\310251823\\AppData\\Local\\Continuum\\Anaconda3\\lib\\site-packages\\pyinstaller-3.2-py3.5.egg\\PyInstaller\\fake-modules'
10772 INFO: Processing pre-safe import module hook   win32com
13072 INFO: Processing pre-safe import module hook   six.moves
28631 INFO: Loading module hooks...
28633 INFO: Loading module hook "hook-jinja2.py"...
28644 INFO: Loading module hook "hook-xml.dom.domreg.py"...
28647 INFO: Loading module hook "hook-_tkinter.py"...
28922 INFO: checking Tree
28922 INFO: Building Tree because out00-Tree.toc is non existent
28922 INFO: Building Tree out00-Tree.toc
28991 INFO: checking Tree
28991 INFO: Building Tree because out01-Tree.toc is non existent
28992 INFO: Building Tree out01-Tree.toc
29005 INFO: Loading module hook "hook-pythoncom.py"...
29569 INFO: Loading module hook "hook-sqlite3.py"...
29573 INFO: Loading module hook "hook-PyQt4.QtGui.py"...
30078 INFO: Loading module hook "hook-jsonschema.py"...
30082 INFO: Loading module hook "hook-win32com.py"...
30194 INFO: Loading module hook "hook-pydoc.py"...
30196 INFO: Loading module hook "hook-encodings.py"...
30205 INFO: Loading module hook "hook-setuptools.py"...
30207 INFO: Loading module hook "hook-requests.py"...
30212 INFO: Loading module hook "hook-matplotlib.py"...
30644 INFO: Loading module hook "hook-lib2to3.py"...
30647 INFO: Loading module hook "hook-matplotlib.backends.py"...
31457 INFO:   Matplotlib backend "GTK": ignored
    Gtk* backend requires pygtk to be installed.
32068 INFO:   Matplotlib backend "GTKAgg": ignored
    Gtk* backend requires pygtk to be installed.
32468 INFO:   Matplotlib backend "GTKCairo": ignored
    No module named 'gtk'
33046 INFO:   Matplotlib backend "MacOSX": ignored
    cannot import name '_macosx'
33684 INFO:   Matplotlib backend "Qt4Agg": added
34328 INFO:   Matplotlib backend "Qt5Agg": added
34923 INFO:   Matplotlib backend "TkAgg": added
35499 INFO:   Matplotlib backend "WX": ignored
    Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
36105 INFO:   Matplotlib backend "WXAgg": ignored
    Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12
36529 INFO:   Matplotlib backend "GTK3Cairo": ignored
    Gtk3 backend requires pygobject to be installed.
37143 INFO:   Matplotlib backend "GTK3Agg": ignored
    Gtk3 backend requires pygobject to be installed.
38607 INFO:   Matplotlib backend "WebAgg": added
39577 INFO:   Matplotlib backend "nbAgg": added
40146 INFO:   Matplotlib backend "agg": added
40539 INFO:   Matplotlib backend "cairo": ignored
    Cairo backend requires that cairocffi or pycairo is installed.
40930 INFO:   Matplotlib backend "emf": ignored
    No module named 'matplotlib.backends.backend_emf'
41330 INFO:   Matplotlib backend "gdk": ignored
    No module named 'gobject'
41939 INFO:   Matplotlib backend "pdf": added
42663 INFO:   Matplotlib backend "pgf": added
43259 INFO:   Matplotlib backend "ps": added
44023 INFO:   Matplotlib backend "svg": added
44768 INFO:   Matplotlib backend "template": added
45009 INFO: Loading module hook "hook-pytz.py"...
45088 INFO: Loading module hook "hook-IPython.py"...
45101 INFO: Excluding import 'PySide'
45113 WARNING:   Removing import IPython.external.qt_loaders from module PySide.QtSvg
45113 WARNING:   Removing import IPython.external.qt_loaders from module PySide
45113 WARNING:   Removing import IPython.external.qt_loaders from module PySide.QtGui
45113 WARNING:   Removing import IPython.external.qt_loaders from module PySide.QtCore
45114 INFO: Excluding import 'PyQt4'
45124 WARNING:   Removing import IPython.external.qt_loaders from module PyQt4.QtCore
45124 WARNING:   Removing import IPython.external.qt_loaders from module PyQt4.QtSvg
45124 WARNING:   Removing import IPython.external.qt_loaders from module PyQt4
45141 WARNING:   Removing import IPython.external.qt_loaders from module PyQt4.QtGui
45144 INFO: Excluding import 'matplotlib'
45159 WARNING:   Removing import IPython.core.pylabtools from module matplotlib
45163 WARNING:   Removing import IPython.core.pylabtools from module matplotlib._pylab_helpers
45163 WARNING:   Removing import IPython.core.pylabtools from module matplotlib.rcParams
45164 WARNING:   Removing import IPython.core.pylabtools from module matplotlib.pylab
45164 WARNING:   Removing import IPython.core.pylabtools from module matplotlib.figure
45164 WARNING:   Removing import IPython.core.pylabtools from module matplotlib.pyplot
45164 WARNING:   Removing import IPython.core.pylabtools from module matplotlib.figure.Figure
45166 INFO: Excluding import 'gtk'
45175 WARNING:   Removing import IPython.lib.inputhook from module gtk
45175 WARNING:   Removing import IPython.lib.inputhookgtk from module gtk
45177 INFO: Excluding import 'tkinter'
45186 WARNING:   Removing import IPython.lib.inputhook from module tkinter
45189 WARNING:   Removing import IPython.lib.clipboard from module tkinter
45189 INFO: Excluding import 'PyQt5'
45200 WARNING:   Removing import IPython.external.qt_loaders from module PyQt5.QtGui
45202 WARNING:   Removing import IPython.external.qt_loaders from module PyQt5.QtCore
45202 WARNING:   Removing import IPython.external.qt_loaders from module PyQt5
45202 WARNING:   Removing import IPython.external.qt_loaders from module PyQt5.QtSvg
45202 WARNING:   Removing import IPython.external.qt_loaders from module PyQt5.QtWidgets
45203 INFO: Loading module hook "hook-pycparser.py"...
45358 INFO: Loading module hook "hook-pygments.py"...
46509 INFO: Loading module hook "hook-PIL.py"...
46514 INFO: Excluding import 'PyQt5'
46519 WARNING:   Removing import PIL.ImageQt from module PyQt5.QPixmap
46519 WARNING:   Removing import PIL.ImageQt from module PyQt5.qRgba
46519 WARNING:   Removing import PIL.ImageQt from module PyQt5.QImage
46521 WARNING:   Removing import PIL.ImageQt from module PyQt5
46521 INFO: Excluding import 'PySide'
46526 WARNING:   Removing import PIL.ImageQt from module PySide.QImage
46527 WARNING:   Removing import PIL.ImageQt from module PySide
46527 WARNING:   Removing import PIL.ImageQt from module PySide.QPixmap
46527 WARNING:   Removing import PIL.ImageQt from module PySide.qRgba
46528 INFO: Excluding import 'tkinter'
46532 INFO: Import to be excluded not found: 'FixTk'
46532 INFO: Excluding import 'PyQt4'
46539 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtCore
46539 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtCore.QBuffer
46539 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtGui.qRgba
46539 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtCore.QIODevice
46539 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtGui.QImage
46541 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtGui.QPixmap
46542 WARNING:   Removing import PIL.ImageQt from module PyQt4.QtGui
46544 INFO: Loading module hook "hook-PyQt4.QtCore.py"...
46643 INFO: Loading module hook "hook-zmq.py"...
47427 INFO: Excluding import 'zmq.libzmq'
47432 WARNING:   Removing import zmq from module zmq.libzmq
47433 INFO: Loading module hook "hook-PyQt4.QtSvg.py"...
47435 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
47436 INFO: Loading module hook "hook-distutils.py"...
47437 INFO: Loading module hook "hook-xml.py"...
47439 INFO: Loading module hook "hook-pkg_resources.py"...
47440 INFO: Loading module hook "hook-sysconfig.py"...
47442 INFO: Loading module hook "hook-PyQt4.py"...
47443 INFO: Loading module hook "hook-PIL.Image.py"...
47621 INFO: Loading module hook "hook-cryptography.py"...
47627 INFO: Loading module hook "hook-pywintypes.py"...
48177 INFO: Loading module hook "hook-shelve.py"...
48187 INFO: Loading module hook "hook-gevent.monkey.py"...
48192 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
48198 INFO: Excluding import 'tkinter'
48202 INFO: Import to be excluded not found: 'FixTk'
48350 INFO: checking Tree
48351 INFO: Building Tree because out02-Tree.toc is non existent
48351 INFO: Building Tree out02-Tree.toc
48581 INFO: checking Tree
48582 INFO: Building Tree because out03-Tree.toc is non existent
48582 INFO: Building Tree out03-Tree.toc
48585 INFO: Looking for ctypes DLLs
48657 INFO: Analyzing run-time hooks ...
48677 INFO: Including run-time hook 'pyi_rth_pkgres.py'
48680 INFO: Including run-time hook 'pyi_rth_traitlets.py'
48682 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
48687 INFO: Including run-time hook 'pyi_rth__tkinter.py'
48690 INFO: Including run-time hook 'pyi_rth_qt4plugins.py'
48693 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
48695 INFO: Including run-time hook 'pyi_rth_mpldata.py'
48742 INFO: Looking for dynamic libraries
65958 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\socket.cp35-win_amd64.p
yd
66065 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\_device.cp35-win_amd64.
pyd
66161 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\error.cp35-win_amd64.py
d
66361 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\context.cp35-win_amd64.
pyd
66574 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\_version.cp35-win_amd64
.pyd
66679 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\utils.cp35-win_amd64.py
d
66797 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\message.cp35-win_amd64.
pyd
66983 WARNING: lib not found: libzmq.cp35-win_amd64.pyd dependency of C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\_poll.cp35-win_amd64.py
d
75241 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-utility-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
76302 WARNING: Can not get binary dependencies for file: C:\Users\310251823\AppData\Local\Continuum\Anaconda3\api-ms-win-crt-multibyte-l1-1-0.dll
Traceback (most recent call last):
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 695, in getImports
    return _getImports_pe(pth)
  File "C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
    dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
86495 INFO: Found C:\windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
86496 INFO: Found C:\windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
86726 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_none ...
86726 INFO: Found manifest C:\windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251.manifest
86728 INFO: Searching for file msvcr90.dll
86728 INFO: Found file C:\windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\msvcr90.dll
86728 INFO: Searching for file msvcp90.dll
86729 INFO: Found file C:\windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\msvcp90.dll
86729 INFO: Searching for file msvcm90.dll
86729 INFO: Found file C:\windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\msvcm90.dll
86947 INFO: Found C:\windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
86948 INFO: Found C:\windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
86949 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 6161)
92515 WARNING: Attempted to add Python module twice with different upper/lowercases: PyQt4.QtCore
92515 WARNING: Attempted to add Python module twice with different upper/lowercases: PyQt4.QtSvg
92515 WARNING: Attempted to add Python module twice with different upper/lowercases: PyQt4.QtGui
92516 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._imaging
92516 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._imagingft
92516 INFO: Looking for eggs
92517 INFO: Using Python library C:\Users\310251823\AppData\Local\Continuum\Anaconda3\python35.dll
92517 INFO: Found binding redirects:
[BindingRedirect(name='Microsoft.VC90.CRT', language=None, arch='amd64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 6161), publicKeyToken='1fc8b3b9a1e18e3b')]
92561 INFO: Warnings written to C:\Users\310251823\PycharmProjects\Prove1\build\Prova\warnProva.txt
92722 INFO: checking PYZ
92722 INFO: Building PYZ because out00-PYZ.toc is non existent
92722 INFO: Building PYZ (ZlibArchive) C:\Users\310251823\PycharmProjects\Prove1\build\Prova\out00-PYZ.pyz
96605 INFO: checking PKG
96605 INFO: Building PKG because out00-PKG.toc is non existent
96605 INFO: Building PKG (CArchive) out00-PKG.pkg
96703 INFO: Bootloader C:\Users\310251823\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyinstaller-3.2-py3.5.egg\PyInstaller\bootloader\Windows-64bit\run.exe
96703 INFO: checking EXE
96703 INFO: Building EXE because out00-EXE.toc is non existent
96703 INFO: Building EXE from out00-EXE.toc
96703 INFO: Appending archive to EXE C:\Users\310251823\PycharmProjects\Prove1\build\Prova\Prova.exe
96733 INFO: checking COLLECT
96733 INFO: Building COLLECT because out00-COLLECT.toc is non existent
96733 INFO: Building COLLECT out00-COLLECT.toc

Here seems something like what I have, but I do not understand the solution. How can I import the 'packaging' package into the .spec file?

Thank you, Sm

Community
  • 1
  • 1
Smartis
  • 55
  • 1
  • 2
  • 7

2 Answers2

0

First of all I see in the pyinstaller log that the PIL hook is loaded, which excludes the tkinter module required by matplotlib. This is a common problem, that I also had, and the error message doesn't always point to that direction.

To solve it, I did two things.

  1. Use import Tkinter and import FileDialog in my code. Preferably after importing PIL.
  2. Download and install the latest development version of pyinstaller. 3.2 was still giving me issues.

If the packaging error persists, you can add it as a hidden-import. In the .spec file, that is an option of the Analysis.

Repiklis
  • 399
  • 6
  • 20
  • Thank you for your replay and your hint. On Monday I'll try and let you know. – Smartis Aug 19 '16 at 19:08
  • Ok, is working. I just updated pyinstaller to the developer version. I tried with and without import and everything is good in both cases. I didn't edit the .spec file. Sholud I run it with or without import? Now I`m testing it on a more complicated program and is working properly. Thank you so much, Sm – Smartis Aug 22 '16 at 05:59
  • Good to know that it is working. Don't use the imports if it works. I used them to solve the issue in an older pyinstaller version. It is possible that the latest development version doesn't require them. – Repiklis Aug 22 '16 at 09:00
0

A part of setuptools, pkg_resources._vendor.packaging is missing in case of anaconda. As it says, it might be necessary to contact the packager of the distribution.

Development version of pyinstaller can be installed by

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

That version seems to work with anaconda3 and it even copies necessary dll dependencies. tkinter.filedialog needs to be specified as a hidden import though.

It is possible to install a more standard version of setuptools by

python -m pip install --upgrade --force-reinstall setuptools

I don't know if this causes problems with anaconda though.

I was able to build an executable of your script after installing another version of setuptools, adding tkinter.filedialog as a hidden import, and copying mkl_*.dll files from Anaconda3/Library/bin folder.

J.J. Hakala
  • 6,136
  • 6
  • 27
  • 61