I created simple HelloWorld program and tried to create .exe using PyInstaller
.exe is created but doesnot run.
Errors while Compiling
PS E:\Pot> pyinstaller it.py
62 INFO: PyInstaller: 3.6
62 INFO: Python: 3.8.3
62 INFO: Platform: Windows-10-10.0.18362-SP0
62 INFO: wrote E:\Pot\it.spec
62 INFO: UPX is not available.
62 INFO: Extending PYTHONPATH with paths
['E:\\Pot', 'E:\\Pot']
62 INFO: checking Analysis
62 INFO: Building Analysis because Analysis-00.toc is non existent
62 INFO: Initializing module dependency graph...
62 INFO: Caching module graph hooks...
78 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 13, in walk_packages
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 130, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 149, in _iter_file_finder_modules
import inspect
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\inspect.py", line 40, in <module>
import linecache
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\linecache.py", line 11, in <module>
import tokenize
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\tokenize.py", line 32, in <module>
import re
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 13, in walk_packages
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 130, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 149, in _iter_file_finder_modules
import inspect
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\inspect.py", line 40, in <module>
import linecache
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\linecache.py", line 11, in <module>
import tokenize
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\tokenize.py", line 32, in <module>
import re
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
2514 INFO: Processing pre-find module path hook distutils
2514 INFO: distutils: retargeting to non-venv dir 'c:\\users\\paritosh malik\\appdata\\local\\programs\\python\\python38\\lib'
3952 INFO: Caching module dependency graph...
4014 INFO: running Analysis Analysis-00.toc
4014 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\paritosh malik\appdata\local\programs\python\python38\python.exe
4280 INFO: Analyzing E:\Pot\it.py
4280 INFO: Processing module hooks...
4280 INFO: Loading module hook "hook-distutils.py"...
4295 INFO: Loading module hook "hook-encodings.py"...
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 13, in walk_packages
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 130, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\pkgutil.py", line 149, in _iter_file_finder_modules
import inspect
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\inspect.py", line 40, in <module>
import linecache
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\linecache.py", line 11, in <module>
import tokenize
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\tokenize.py", line 32, in <module>
import re
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
4389 INFO: Loading module hook "hook-lib2to3.py"...
4389 INFO: Loading module hook "hook-pydoc.py"...
4389 INFO: Loading module hook "hook-sysconfig.py"...
4389 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
4389 INFO: Loading module hook "hook-xml.py"...
4436 INFO: Loading module hook "hook-_tkinter.py"...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\tkinter\__init__.py", line 39, in <module>
import re
File "c:\users\paritosh malik\appdata\local\programs\python\python38\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
4592 ERROR: Tcl/Tk improperly installed on this system.
4608 INFO: Looking for ctypes DLLs
4655 INFO: Analyzing run-time hooks ...
4655 INFO: Including run-time hook 'pyi_rth__tkinter.py'
4655 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
4670 INFO: Looking for dynamic libraries
4717 WARNING: lib not found: pywintypes38.dll dependency of c:\users\paritosh malik\appdata\local\programs\python\python38\lib\site-packages\win32\win32evtlog.pyd
4733 WARNING: lib not found: pywintypes38.dll dependency of c:\users\paritosh malik\appdata\local\programs\python\python38\lib\site-packages\win32\win32api.pyd
4889 INFO: Looking for eggs
4889 INFO: Using Python library c:\users\paritosh malik\appdata\local\programs\python\python38\python38.dll
4889 INFO: Found binding redirects:
[]
4889 INFO: Warnings written to E:\Pot\build\it\warn-it.txt
4936 INFO: Graph cross-reference written to E:\Pot\build\it\xref-it.html
4951 INFO: checking PYZ
4951 INFO: Building PYZ because PYZ-00.toc is non existent
4951 INFO: Building PYZ (ZlibArchive) E:\Pot\build\it\PYZ-00.pyz
5529 INFO: Building PYZ (ZlibArchive) E:\Pot\build\it\PYZ-00.pyz completed successfully.
5545 INFO: checking PKG
5545 INFO: Building PKG because PKG-00.toc is non existent
5545 INFO: Building PKG (CArchive) PKG-00.pkg
5561 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
5561 INFO: Bootloader c:\users\paritosh malik\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
5561 INFO: checking EXE
5561 INFO: Building EXE because EXE-00.toc is non existent
5561 INFO: Building EXE from EXE-00.toc
5576 INFO: Appending archive to EXE E:\Pot\build\it\it.exe
5576 INFO: Building EXE from EXE-00.toc completed successfully.
5576 INFO: checking COLLECT
5576 INFO: Building COLLECT because COLLECT-00.toc is non existent
5592 INFO: Building COLLECT COLLECT-00.toc
5811 INFO: Building COLLECT COLLECT-00.toc completed successfully.
Error while running the .exe
PS E:\Pot> dist\it\it
Python path configuration:
PYTHONHOME = 'E:\Pot\dist\it'
PYTHONPATH = (not set)
program name = 'E:\Pot\dist\it\it.exe'
isolated = 0
environment = 0
user site = 0
import site = 0
sys._base_executable = 'E:\\Pot\\dist\\it\\it.exe'
sys.base_prefix = ''
sys.base_exec_prefix = ''
sys.executable = 'E:\\Pot\\dist\\it\\it.exe'
sys.prefix = ''
sys.exec_prefix = ''
sys.path = [
'E:\\Pot\\dist\\it\\base_library.zip',
'E:\\Pot\\dist\\it',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
LookupError: unknown encoding: utf-8
Current thread 0x000046f8 (most recent call first):
<no Python frame>
PS E:\Pot>
I tried adding "utf_8.pyc" into encodings folder in base_library.zip but then it shows some other error init_sys_streams
So I think error is in lack of files in base_library.zip
Please Help..
Please Help..
Please Help..
Please Help..
Pyinstaller doesn't support Python 3.8 yet, see this open feature request: https://github.com/pyinstaller/pyinstaller/issues/4311
Try using Python 3.7 instead.
Related
I'm trying to put a simple flask server into executable by using pyinstaller -F server.py command
When running the exe file, I obtain the following error:
Traceback (most recent call last):
File "server.py", line 4, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "transform.py", line 17, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "convert.py", line 12, in <module>
File "pymorphy2\analyzer.py", line 200, in __init__
File "pymorphy2\analyzer.py", line 280, in choose_dictionary_path
File "pymorphy2\analyzer.py", line 144, in lang_dict_path
ValueError: Can't find a dictionary for language 'ru'. Installed languages: []. Try installing pymorphy2-dicts-ru package.
[18156] Failed to execute script server
Already tried to pip install pymorphy2-dicts-ru, it didn't help
Below are the logs of pyinstaller -F server.py
96 INFO: PyInstaller: 4.1
97 INFO: Python: 3.6.8
97 INFO: Platform: Windows-10-10.0.19041-SP0
103 INFO: wrote C:\Users\pc\Desktop\hack\code\nlp-server\server.spec
118 INFO: UPX is not available.
122 INFO: Extending PYTHONPATH with paths
['C:\\Users\\pc\\Desktop\\hack\\code\\nlp-server',
'C:\\Users\\pc\\Desktop\\hack\\code\\nlp-server']
139 INFO: checking Analysis
140 INFO: Building Analysis because Analysis-00.toc is non existent
140 INFO: Initializing module dependency graph...
145 INFO: Caching module graph hooks...
169 INFO: Analyzing base_library.zip ...
3178 INFO: Caching module dependency graph...
3265 INFO: running Analysis Analysis-00.toc
3268 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\pc\appdata\local\programs\python\python36\python.exe
3440 INFO: Analyzing C:\Users\pc\Desktop\hack\code\nlp-server\server.py
4658 INFO: Processing pre-find module path hook distutils from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
4659 INFO: distutils: retargeting to non-venv dir 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib'
7000 INFO: Processing pre-safe import module hook setuptools.extern.six.moves from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-setuptools.extern.six.m
oves.py'.
7477 INFO: Processing pre-find module path hook site from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
7478 INFO: site: retargeting to fake-dir 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\fake-modules'
10016 INFO: Processing module hooks...
10017 INFO: Loading module hook 'hook-jinja2.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
10031 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10034 INFO: Excluding import of doctest from module difflib
10034 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10035 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10038 INFO: Excluding import of lib2to3.refactor from module distutils.util
10038 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10146 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10148 INFO: Excluding import of doctest from module heapq
10149 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10247 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10249 INFO: Import to be excluded not found: 'test'
10249 INFO: Loading module hook 'hook-numpy.core.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10827 INFO: Loading module hook 'hook-numpy.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10830 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10832 INFO: Excluding import of pytest from module numpy._pytesttester
10833 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10835 INFO: Excluding import of argparse from module pickle
10835 INFO: Loading module hook 'hook-pkg_resources.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
11162 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
11219 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
11462 WARNING: Hidden import "pkg_resources.py2_warn" not found!
11464 WARNING: Hidden import "pkg_resources.markers" not found!
11465 INFO: Excluding import of __main__ from module pkg_resources
11466 INFO: Loading module hook 'hook-setuptools.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12062 INFO: Excluding import of setuptools.py27compat from module setuptools.command.easy_install
12062 INFO: Excluding import of setuptools.py27compat from module setuptools.package_index
12065 INFO: Excluding import of setuptools.py33compat from module setuptools.depends
12065 INFO: Excluding import of setuptools.py33compat from module setuptools.package_index
12066 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12067 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12068 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12121 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12123 INFO: Excluding import of numpy from module setuptools.msvc
12199 INFO: Looking for ctypes DLLs
12231 INFO: Analyzing run-time hooks ...
12237 INFO: Including run-time hook 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
12238 INFO: Including run-time hook 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
12250 INFO: Looking for dynamic libraries
13139 INFO: Looking for eggs
13139 INFO: Using Python library c:\users\pc\appdata\local\programs\python\python36\python36.dll
13139 INFO: Found binding redirects:
[]
13150 INFO: Warnings written to C:\Users\pc\Desktop\hack\code\nlp-server\build\server\warn-server.txt
13296 INFO: Graph cross-reference written to C:\Users\pc\Desktop\hack\code\nlp-server\build\server\xref-server.html
13324 INFO: checking PYZ
13325 INFO: Building PYZ because PYZ-00.toc is non existent
13326 INFO: Building PYZ (ZlibArchive) C:\Users\pc\Desktop\hack\code\nlp-server\build\server\PYZ-00.pyz
14479 INFO: Building PYZ (ZlibArchive) C:\Users\pc\Desktop\hack\code\nlp-server\build\server\PYZ-00.pyz completed successfully.
14505 INFO: checking PKG
14505 INFO: Building PKG because PKG-00.toc is non existent
14505 INFO: Building PKG (CArchive) PKG-00.pkg
20039 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
20043 INFO: Bootloader c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
20043 INFO: checking EXE
20043 INFO: Building EXE because EXE-00.toc is non existent
20043 INFO: Building EXE from EXE-00.toc
20044 INFO: Appending archive to EXE C:\Users\pc\Desktop\hack\code\nlp-server\dist\server.exe
20060 INFO: Building EXE from EXE-00.toc completed successfully.
code of the server.py
from flask import Flask, request, jsonify
from transform import transform_text
server = Flask(__name__);
#server.route('/send', methods=['POST'])
def send():
print("POST /send request")
# obtaining passed args
fname = request.json['fname']
text = request.json['text']
# updating the text
text = f"{transform_text(text, 'Masc', fname)}"
# sending back updated text
return jsonify({'text': text})
if __name__ == '__main__':
server.run(host='0.0.0.0', port='8080', debug=True)
tranform_text() function uses pymorphy to change sentences from 1st person form ("I play") to 3rd person form("He/She plays")
So, is there any way to make the executable work?
This is the problem of the package ;pymorphy2_dicts_ru;. Files from the data directory are not copied to the bundle.
To solve the problem, you need to perform two steps:
Add the data directory to the pyinstaller spec file:
...
# pymorph data
import pymorphy2_dicts_ru
pymorph_data = pymorphy2_dicts_ru.get_path()
a = Analysis(['main.py'],
pathex=['.'],
binaries=[],
datas=[(pymorph_data, 'pymorphy2_dicts_ru/data')],
hiddenimports=[],
hookspath=[],
...
Set the path to the data directory in the code before import the pymorphy2 module (to main.py for example):
...
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
os.environ["PYMORPHY2_DICT_PATH"] = str(pathlib.Path(sys._MEIPASS).joinpath('pymorphy2_dicts_ru/data'))
...
I'm trying to create an executable file using PyInstaller with my script. For reference, I am using Windows 10 with Python 3.8.0 and PyInstaller version 3.5.
My script is called hello_world.py and it is saved in it's own folder.
print("Hello World!")
In command prompt, I navigate to the folder that hello_world.py is in and run:
pyinstaller hello_world.py
And this is the output:
46 INFO: PyInstaller: 3.5
46 INFO: Python: 3.8.0
46 INFO: Platform: Windows-10-10.0.17763-SP0
62 INFO: wrote F:\Python\Python Scripts\Pyinstaller\Py installer test\hello_world.spec
78 INFO: UPX is not available.
78 INFO: Extending PYTHONPATH with paths
['F:\\Python\\Python Scripts\\Pyinstaller\\Py installer test',
'F:\\Python\\Python Scripts\\Pyinstaller\\Py installer test']
78 INFO: checking Analysis
78 INFO: Building Analysis because Analysis-00.toc is non existent
78 INFO: Initializing module dependency graph...
93 INFO: Initializing module graph hooks...
93 INFO: Analyzing base_library.zip ...
3592 INFO: running Analysis Analysis-00.toc
3592 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\l&a\appdata\local\programs\python\python38\python.exe
4014 INFO: Caching module hooks...
4014 INFO: Analyzing F:\Python\Python Scripts\Pyinstaller\Py installer test\hello_world.py
4045 INFO: Loading module hooks...
4045 INFO: Loading module hook "hook-encodings.py"...
4202 INFO: Loading module hook "hook-pydoc.py"...
4202 INFO: Loading module hook "hook-xml.py"...
4405 INFO: Looking for ctypes DLLs
4420 INFO: Analyzing run-time hooks ...
4420 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
4420 INFO: Looking for dynamic libraries
5592 INFO: Looking for eggs
5592 INFO: Using Python library c:\users\l&a\appdata\local\programs\python\python38\python38.dll
5592 INFO: Found binding redirects:
[]
5592 INFO: Warnings written to F:\Python\Python Scripts\Pyinstaller\Py installer test\build\hello_world\warn-hello_world.txt
5670 INFO: Graph cross-reference written to F:\Python\Python Scripts\Pyinstaller\Py installer test\build\hello_world\xref-hello_world.html
5686 INFO: checking PYZ
5686 INFO: Building PYZ because PYZ-00.toc is non existent
5686 INFO: Building PYZ (ZlibArchive) F:\Python\Python Scripts\Pyinstaller\Py installer test\build\hello_world\PYZ-00.pyz
Traceback (most recent call last):
File "c:\users\l&a\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\l&a\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\L&A\AppData\Local\Programs\Python\Python38\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
exec(code, spec_namespace)
File "F:\Python\Python Scripts\Pyinstaller\Py installer test\hello_world.spec", line 18, in <module>
pyz = PYZ(a.pure, a.zipped_data,
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
self.__postinit__()
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
self.code_dict = {
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\api.py", line 129, in <dictcomp>
key: strip_paths_in_code(code)
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
consts = tuple(
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
strip_paths_in_code(const_co, new_filename)
File "c:\users\l&a\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\utils.py", line 660, in strip_paths_in_code
return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_stacksize,
TypeError: an integer is required (got type bytes)
This creates folders called 'dist' and 'build' and a file called 'hello_world.spec' but the 'dist' folder is empty. What is going wrong?
I search for
TypeError: an integer is required (got type bytes)
Did you read this?
I had this issue in the past, can you please perform the follwing:
open Anaconda prompt or any other IDE per example spyder or Atom terminal, command line as admin and Navigate to the folder where the .py located and run the command as bellow:
In my example the file I want to compile it is getwindowsversion.py
this is will create just standalone .exe can be used,
pyinstaller --onefile getwindowsversion.py
if you want to create regular build,
pyinstaller getwindowsversion.py
I am trying to ship an executable from my python script which lives inside a virtual environment using pipenv which again relies on pyenv for python versioning. For that, I want to us pyinstaller.
What I did:
pipenv install pyinstaller
pyinstaller --onefile my_script.py
Output:
40 INFO: PyInstaller: 3.5
40 INFO: Python: 3.6.9
41 INFO: Platform: Linux-4.15.0-65-generic-x86_64-with-debian-stretch-sid
42 INFO: wrote /home/matthaeus/cybathlon/planvec/qt_video_gui_example.spec
44 INFO: UPX is not available.
45 INFO: Extending PYTHONPATH with paths
['/home/matthaeus/cybathlon/planvec', '/home/matthaeus/cybathlon/planvec']
45 INFO: checking Analysis
45 INFO: Building Analysis because Analysis-00.toc is non existent
45 INFO: Initializing module dependency graph...
46 INFO: Initializing module graph hooks...
47 INFO: Analyzing base_library.zip ...
2786 INFO: running Analysis Analysis-00.toc
2801 INFO: Caching module hooks...
2805 INFO: Analyzing /home/matthaeus/cybathlon/planvec/qt_video_gui_example.py
3284 INFO: Processing pre-find module path hook distutils
3285 INFO: distutils: retargeting to non-venv dir '/home/matthaeus/.pyenv/versions/3.6.9/lib/python3.6/distutils/__init__.py'
3972 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
4336 INFO: Processing pre-find module path hook site
4337 INFO: site: retargeting to fake-dir '/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/fake-modules'
6327 INFO: Loading module hooks...
6328 INFO: Loading module hook "hook-numpy.core.py"...
6458 INFO: Loading module hook "hook-sysconfig.py"...
6464 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
6534 INFO: Loading module hook "hook-scipy.py"...
6535 INFO: Loading module hook "hook-PyQt5.py"...
6549 WARNING: Hidden import "sip" not found!
6549 INFO: Loading module hook "hook-pkg_resources.py"...
6788 INFO: Processing pre-safe import module hook win32com
7015 INFO: Loading module hook "hook-numpy.py"...
7015 INFO: Loading module hook "hook-cv2.py"...
7016 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
7048 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
7096 INFO: Loading module hook "hook-pydoc.py"...
7097 INFO: Loading module hook "hook-xml.py"...
7150 INFO: Loading module hook "hook-encodings.py"...
7203 INFO: Loading module hook "hook-setuptools.py"...
7423 WARNING: Hidden import "distutils.command.build_ext" not found!
7680 INFO: Looking for ctypes DLLs
7762 INFO: Analyzing run-time hooks ...
7769 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
7770 INFO: Including run-time hook 'pyi_rth_pkgres.py'
7771 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
7785 INFO: Looking for dynamic libraries
9784 INFO: Looking for eggs
9784 INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/bin/pyinstaller", line 8, in <module>
sys.exit(run())
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 791, in build
exec(code, spec_namespace)
File "/home/matthaeus/cybathlon/planvec/qt_video_gui_example.spec", line 17, in <module>
noarchive=False)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 243, in __init__
self.__postinit__()
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
self.assemble()
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 575, in assemble
self._check_python_library(self.binaries)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 681, in _check_python_library
raise IOError(msg)
OSError: Python library not found: libpython3.6mu.so.1.0, libpython3.6m.so, libpython3.6m.so.1.0, libpython3.6.so.1.0
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
* On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
* apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
I tried the recommended python3-dev and python-dev installations without luck.
Now, I hope someone can enlighten me what is going on here!
Cheers,
Matt
You need to build with CPython shared-library enabled.
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.9
eval "$(pyenv init -)"
Reference: https://github.com/pyenv/pyenv/wiki
I'm trying to compile my django Project With PyInstaller, cuz of be safe in a shared disk driver That every One can review My Code.
and when Compile I get this output:
(env) D:__DEV__>pyinstaller Chortke/manage.py --onedir
222 INFO: PyInstaller: 4.0.dev0+46286a1f4
222 INFO: Python: 3.7.4 (conda)
222 INFO: Platform: Windows-10-10.0.16299-SP0
222 INFO: wrote D:\__DEV__\manage.spec
222 INFO: UPX is not available.
239 INFO: Extending PYTHONPATH with paths
['D:\\__DEV__\\Chortke', 'D:\\__DEV__']
239 INFO: checking Analysis
239 INFO: Building Analysis because Analysis-00.toc is non existent
239 INFO: Initializing module dependency graph...
244 INFO: Caching module graph hooks...
256 INFO: Analyzing base_library.zip ...
6561 INFO: Caching module dependency graph...
6664 INFO: running Analysis Analysis-00.toc
6679 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\mab\.conda\envs\env\python.exe
7249 INFO: Analyzing D:\__DEV__\Chortke\manage.py
7307 INFO: Processing pre-find module path hook distutils
7311 INFO: distutils: retargeting to non-venv dir 'c:\\users\\mab\\.conda\\envs\\env\\lib'
8887 INFO: Processing pre-find module path hook site
8887 INFO: site: retargeting to fake-dir 'c:\\users\\mab\\.conda\\envs\\env\\lib\\site-packages\\PyInstaller\\fake-modules'
15264 INFO: Processing module hooks...
15264 INFO: Loading module hook "hook-distutils.py"...
15264 INFO: Loading module hook "hook-django.core.cache.py"...
15439 INFO: Loading module hook "hook-django.core.mail.py"...
15601 INFO: Loading module hook "hook-django.core.management.py"...
15634 INFO: Import to be excluded not found: 'tkinter'
15635 INFO: Import to be excluded not found: 'IPython'
15635 INFO: Import to be excluded not found: 'matplotlib'
15635 INFO: Loading module hook "hook-django.db.backends.py"...
17084 WARNING: Hidden import "django.db.backends.__pycache__.base" not found!
17084 INFO: Loading module hook "hook-django.py"...
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 36, in walk_packages
File "<string>", line 36, in walk_packages
File "<string>", line 20, in walk_packages
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\admin\__init__.py", line 5, in <module>
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\admin\options.py", line 2, in <module>
from django.contrib.gis.admin.widgets import OpenLayersWidget
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\admin\widgets.py", line 3, in <module>
from django.contrib.gis.gdal import GDALException
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\gdal\datasource.py", line 39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\gdal\driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 43, in <module>
% '", "'.join(lib_names)
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal203", "gdal202", "gdal201", "gdal20", "gdal111"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
19403 INFO: Determining a mapping of distributions to packages...
24054 INFO: Packages required by django:
['sqlparse', 'pytz']
24054 INFO: Django root directory D:\__DEV__\Chortke\chortke
Traceback (most recent call last):
File "c:\users\mab\.conda\envs\env\lib\site-packages\PyInstaller\utils\hooks\subproc\django_import_finder.py", line 37, in <module>
list(settings.TEMPLATE_LOADERS) + \
File "c:\users\mab\.conda\envs\env\lib\site-packages\django\conf\__init__.py", line 80, in __getattr__
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'
25398 INFO: Collecting Django migration scripts.
31358 INFO: Loading module hook "hook-encodings.py"...
31458 INFO: Loading module hook "hook-PIL.Image.py"...
32433 INFO: Loading module hook "hook-PIL.py"...
32433 INFO: Excluding import 'PySide'
32433 INFO: Removing import of PySide from module PIL.ImageQt
32449 INFO: Excluding import 'PyQt4'
32452 INFO: Removing import of PyQt4 from module PIL.ImageQt
32452 INFO: Excluding import 'PyQt5'
32454 INFO: Removing import of PyQt5 from module PIL.ImageQt
32455 INFO: Excluding import 'tkinter'
32458 INFO: Removing import of tkinter from module PIL.ImageTk
32458 INFO: Import to be excluded not found: 'FixTk'
32458 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
32460 INFO: Excluding import 'tkinter'
32462 INFO: Import to be excluded not found: 'FixTk'
32462 INFO: Loading module hook "hook-pkg_resources.py"...
32934 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
33011 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
33134 INFO: Excluding import '__main__'
33136 INFO: Removing import of __main__ from module pkg_resources
33136 INFO: Loading module hook "hook-pydoc.py"...
33137 INFO: Loading module hook "hook-pytz.py"...
33208 INFO: Loading module hook "hook-sqlite3.py"...
33307 INFO: Loading module hook "hook-sysconfig.py"...
33307 INFO: Loading module hook "hook-xml.dom.domreg.py"...
33307 INFO: Loading module hook "hook-xml.py"...
33307 INFO: Loading module hook "hook-_tkinter.py"...
33579 INFO: checking Tree
33579 INFO: Building Tree because Tree-00.toc is non existent
33579 INFO: Building Tree Tree-00.toc
33663 INFO: checking Tree
33663 INFO: Building Tree because Tree-01.toc is non existent
33663 INFO: Building Tree Tree-01.toc
33683 INFO: Loading module hook "hook-django.db.backends.mysql.base.py"...
33697 INFO: Loading module hook "hook-django.db.backends.oracle.base.py"...
33806 INFO: Looking for ctypes DLLs
33894 INFO: Analyzing run-time hooks ...
33900 INFO: Including run-time hook 'pyi_rth_pkgres.py'
33901 INFO: Including run-time hook 'pyi_rth_django.py'
33907 INFO: Looking for dynamic libraries
34271 INFO: Looking for eggs
34271 INFO: Using Python library c:\users\mab\.conda\envs\env\python37.dll
34271 INFO: Found binding redirects:
[]
34271 INFO: Warnings written to D:\__DEV__\build\manage\warn-manage.txt
34435 INFO: Graph cross-reference written to D:\__DEV__\build\manage\xref-manage.html
34710 INFO: checking PYZ
34710 INFO: Building PYZ because PYZ-00.toc is non existent
34710 INFO: Building PYZ (ZlibArchive) D:\__DEV__\build\manage\PYZ-00.pyz
35823 INFO: Building PYZ (ZlibArchive) D:\__DEV__\build\manage\PYZ-00.pyz completed successfully.
35874 INFO: checking PKG
35875 INFO: Building PKG because PKG-00.toc is non existent
35875 INFO: Building PKG (CArchive) PKG-00.pkg
35896 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
35904 INFO: Bootloader c:\users\mab\.conda\envs\env\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
35904 INFO: checking EXE
35904 INFO: Building EXE because EXE-00.toc is non existent
35905 INFO: Building EXE from EXE-00.toc
35905 INFO: Appending archive to EXE D:\__DEV__\build\manage\manage.exe
36000 INFO: Building EXE from EXE-00.toc completed successfully.
36014 INFO: checking COLLECT
36015 INFO: Building COLLECT because COLLECT-00.toc is non existent
36015 INFO: Building COLLECT COLLECT-00.toc
134331 INFO: Building COLLECT COLLECT-00.toc completed successfully.
And When i Run the exe file, I get this Error:
(env) D:__DEV__>dist\manage\manage.exe runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "threading.py", line 926, in _bootstrap_inner
File "threading.py", line 870, in run
File "site-packages\django\utils\autoreload.py", line 54, in wrapper
File "D:\__DEV__\dist\manage\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
File "site-packages\django\core\management\__init__.py", line 337, in execute
File "site-packages\django\utils\autoreload.py", line 54, in wrapper
File "site-packages\django\__init__.py", line 24, in setup
File "site-packages\django\apps\registry.py", line 91, in populate
File "site-packages\django\apps\config.py", line 90, in create
File "importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django_admin_select2'
Traceback (most recent call last):
File "manage.py", line 15, in <module>
File "site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
File "site-packages\django\core\management\__init__.py", line 375, in execute
File "site-packages\django\core\management\base.py", line 323, in run_from_argv
File "D:\__DEV__\dist\manage\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "site-packages\django\core\management\base.py", line 364, in execute
File "D:\__DEV__\dist\manage\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "D:\__DEV__\dist\manage\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "site-packages\django\utils\autoreload.py", line 598, in run_with_reloader
File "site-packages\django\utils\autoreload.py", line 583, in start_django
File "site-packages\django\utils\autoreload.py", line 301, in run
File "site-packages\django\utils\autoreload.py", line 307, in run_loop
File "site-packages\django\utils\autoreload.py", line 347, in tick
File "site-packages\django\utils\autoreload.py", line 363, in snapshot_files
File "site-packages\django\utils\autoreload.py", line 262, in watched_files
File "site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
File "site-packages\django\utils\autoreload.py", line 139, in iter_modules_and_files
File "pathlib.py", line 1346, in exists
File "pathlib.py", line 1168, in stat
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
[5108] Failed to execute script manage
Plugins that installed:
(env) D:__DEV__>pip freeze
altgraph==0.16.1
astroid==2.2.5
backports.csv==1.0.7
certifi==2019.6.16
colorama==0.4.1
defusedxml==0.6.0
diff-match-patch==20181111
Django==2.2.4
django-admin-rangefilter==0.5.0
django-admin-select2==1.0.1
django-import-export==1.2.0
django-jalali==3.1.0
django-modeladmin-reorder==0.3.1
django-nested-admin==3.2.3
et-xmlfile==1.0.1
Faker==1.0.7
future==0.17.1
isort==4.3.21
jdatetime==3.2.0
jdcal==1.4.1
lazy-object-proxy==1.4.1
mccabe==0.6.1
odfpy==1.4.0
openpyxl==2.6.2
pefile==2019.4.18
Pillow==6.1.0
PyInstaller==4.0.dev0+46286a1f4
pylint==2.3.1
python-dateutil==2.8.0
python-monkey-business==1.0.0
pytz==2019.2
pywin32-ctypes==0.2.0
PyYAML==5.1.2
six==1.12.0
sqlparse==0.3.0
tablib==0.13.0
text-unidecode==1.2
typed-ast==1.4.0
wincertstore==0.2
wrapt==1.11.2
xlrd==1.2.0
xlwt==1.3.0
In my system i used to downgrade the django version from 2.2 to 1.8 in pyinstaller 3.4 version(pyinstaller 3.5 leads to kind of numpy error). Afterwards this error was resolved.
Refer this link
Django Middleware Error - Middleware changed for 1.7
When I build a simple hello world application with PyInstaller, it works as expected. But as soon as I import something from PySide it stops working. Here is the main.py:
from PySide.QtGui import QApplication
print "Hello World"
The build process goes smoothly, but the resulting binary doesn't work:
(pyside) C:\Test\pyinstaller>main\dist\main\main.exe
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "C:\Test\pyinstaller\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Test\pyinstaller\PyInstaller\loader\iu.py", line 480, in doimport
exec co in mod.__dict__
File "C:\Test\pyinstaller\main\build\pyi.win32\main\out00-PYZ.pyz\PySide", lin
e 55, in <module>
File "C:\Test\pyinstaller\main\build\pyi.win32\main\out00-PYZ.pyz\PySide", lin
e 11, in _setupQtDirectories
File "C:\Test\pyinstaller\main\build\pyi.win32\main\out00-PYZ.pyz\PySide._util
s", line 87, in get_pyside_dir
File "C:\Test\pyinstaller\main\build\pyi.win32\main\out00-PYZ.pyz\PySide._util
s", line 83, in _get_win32_case_sensitive_name
File "C:\Test\pyinstaller\main\build\pyi.win32\main\out00-PYZ.pyz\PySide._util
s", line 58, in _get_win32_short_name
WindowsError: [Error 123] The filename, directory name, or volume label syntax i
s incorrect.
Notice that this happens even though I'm just importing a PySide module, not actually using it. What should I do?
I am using PyInstaller 2.0 to package an app with PySide 1.2 on 64-bit windows 7. My Python installation is 32-bit:
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
>pip freeze
pyside==1.2.0
pywin32==218
And here is the build message:
(pyside) C:\Test\pyinstaller>python pyinstaller.py ..\main.py
90 INFO: wrote C:\Test\pyinstaller\main\main.spec
113 INFO: Testing for ability to set icons, version resources...
162 INFO: ... resource update available
204 INFO: UPX is available.
1237 INFO: checking Analysis
1237 INFO: building Analysis because out00-Analysis.toc non existent
1238 INFO: running Analysis out00-Analysis.toc
1240 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
1313 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21
022.8_none ...
1314 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc
8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest
1316 INFO: Searching for file msvcr90.dll
1317 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_
9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll
1317 INFO: Searching for file msvcp90.dll
1319 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_
9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll
1319 INFO: Searching for file msvcm90.dll
1319 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_
9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll
1447 INFO: Analyzing C:\Test\pyinstaller\support\_pyi_bootstrap.py
2601 INFO: Analyzing C:\Test\pyinstaller\PyInstaller\loader\archive.py
2687 INFO: Analyzing C:\Test\pyinstaller\PyInstaller\loader\carchive.py
2776 INFO: Analyzing C:\Test\pyinstaller\PyInstaller\loader\iu.py
2800 INFO: Analyzing ..\main.py
2893 INFO: Hidden import 'encodings' has been found otherwise
2894 INFO: Looking for run-time hooks
2895 INFO: Analyzing rthook C:\Test\pyinstaller\support/rthooks/pyi_rth_encoding
s.py
7438 INFO: Warnings written to C:\Test\pyinstaller\main\build\pyi.win32\main\war
nmain.txt
7444 INFO: checking PYZ
7445 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
7445 INFO: building PYZ out00-PYZ.toc
8059 INFO: checking PKG
8060 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
8061 INFO: building PKG out00-PKG.pkg
8072 INFO: checking EXE
8073 INFO: rebuilding out00-EXE.toc because main.exe missing
8073 INFO: building EXE from out00-EXE.toc
8075 INFO: Appending archive to EXE C:\Test\pyinstaller\main\build\pyi.win32\mai
n\main.exe
8151 INFO: checking COLLECT
8151 INFO: building COLLECT out00-COLLECT.toc
EDIT: This happens even if I call from PySide import QtGui as it suggests in this answer.
Encountering same question, solved by using PyInstaller 1.5.