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
Related
I have a Python project is based on matplotlib. I use PyInstaller to build executables on my Intel Mac that should eventually run on both Intel and Apple Macs. This fails, because the binary for TkAgg is Intel-only.
(progress_simulator) joerg#Jorgs-MBP progress_simulator % pyinstaller --windowed --onefile --target-arch universal2 --collect-all tkinterweb ProgressDetourSim.py
84 INFO: PyInstaller: 5.7.0
84 INFO: Python: 3.11.1
95 INFO: Platform: macOS-13.0.1-x86_64-i386-64bit
96 INFO: wrote /Users/joerg/progress_simulator/ProgressDetourSim.spec
99 INFO: UPX is not available.
353 INFO: Determining a mapping of distributions to packages...
1207 WARNING: Unable to find package for requirement pillow from package tkinterweb.
1207 INFO: Packages required by tkinterweb:
[]
1207 INFO: Extending PYTHONPATH with paths
['/Users/joerg/progress_simulator']
1437 INFO: checking Analysis
1465 INFO: Appending 'binaries' from .spec
1465 INFO: Appending 'datas' from .spec
1467 INFO: checking PYZ
1475 INFO: EXE target arch: universal2
1475 INFO: Code signing identity: None
1476 INFO: checking PKG
1482 INFO: Building because toc changed
1482 INFO: Building PKG (CArchive) ProgressDetourSim.pkg
Traceback (most recent call last):
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/bin/pyinstaller", line 8, in <module>
sys.exit(_console_script_run())
^^^^^^^^^^^^^^^^^^^^^
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/__main__.py", line 194, in _console_script_run
run()
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/__main__.py", line 180, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/__main__.py", line 61, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 971, in main
build(specfile, distpath, workpath, clean_build)
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 893, in build
exec(code, spec_namespace)
File "/Users/joerg/progress_simulator/ProgressDetourSim.spec", line 31, in <module>
exe = EXE(
^^^^
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/api.py", line 534, in __init__
self.pkg = PKG(
^^^^
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/api.py", line 216, in __init__
self.__postinit__()
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/datastruct.py", line 173, in __postinit__
self.assemble()
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/api.py", line 270, in assemble
fnm = checkCache(
^^^^^^^^^^^
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/building/utils.py", line 373, in checkCache
osxutils.binary_to_target_arch(cachedfile, target_arch, display_name=fnm)
File "/Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/PyInstaller/utils/osx.py", line 312, in binary_to_target_arch
raise IncompatibleBinaryArchError(f"{display_name} is not a fat binary!")
PyInstaller.utils.osx.IncompatibleBinaryArchError: /Users/joerg/.local/share/virtualenvs/progress_simulator-bvQB0wNI/lib/python3.11/site-packages/matplotlib/backends/_tkagg.cpython-311-darwin.so is not a fat binary!
(progress_simulator) joerg#Jorgs-MBP progress_simulator %
How can I resolve this, where can I get a universal2 version of TkAgg?
Alternatively, what would be the best way to obtain a Mac app that plots graphs similar to how matplotlib works and that runs on both Intel and Apple silicon?
i have just one line of code, and i am trying to generate the exe with pyinstaller command.
import miniaudio
command = pyinstaller <filename>.py
output:
116 INFO: PyInstaller: 4.2
116 INFO: Python: 3.9.2
117 INFO: Platform: Windows-10-10.0.19041-SP0
118 INFO: wrote C:\Users\Χρήστος\Desktop\radio\peradio2.spec
121 INFO: UPX is not available.
122 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Χρήστος\\Desktop\\radio', 'C:\\Users\\Χρήστος\\Desktop\\radio']
135 INFO: checking Analysis
138 INFO: Building because C:\Users\Χρήστος\Desktop\radio\peradio2.py changed
138 INFO: Initializing module dependency graph...
141 INFO: Caching module graph hooks...
148 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
152 INFO: Analyzing base_library.zip ...
2350 INFO: Processing pre-find module path hook distutils from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2351 INFO: distutils: retargeting to non-venv dir 'c:\\python\\lib'
5208 INFO: Caching module dependency graph...
5297 INFO: running Analysis Analysis-00.toc
5314 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\python\python.exe
5389 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\python\python39.dll
5564 INFO: Analyzing C:\Users\Χρήστος\Desktop\radio\peradio2.py
5566 INFO: Processing module hooks...
5567 INFO: Loading module hook 'hook-difflib.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5569 INFO: Excluding import of doctest from module difflib
5569 INFO: Loading module hook 'hook-distutils.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5570 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5572 INFO: Excluding import of lib2to3.refactor from module distutils.util
5572 INFO: Loading module hook 'hook-encodings.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5642 INFO: Loading module hook 'hook-heapq.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5643 INFO: Excluding import of doctest from module heapq
5644 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5697 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5699 INFO: Excluding import of test from module multiprocessing.util
5699 INFO: Excluding import of test.support from module multiprocessing.util
5700 INFO: Loading module hook 'hook-pickle.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5701 INFO: Excluding import of argparse from module pickle
5701 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5702 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5703 INFO: Loading module hook 'hook-xml.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5760 INFO: Loading module hook 'hook-_tkinter.py' from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5896 INFO: checking Tree
5959 INFO: checking Tree
6148 INFO: checking Tree
6165 INFO: Looking for ctypes DLLs
6188 INFO: Analyzing run-time hooks ...
6191 INFO: Including run-time hook 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
6196 INFO: Looking for dynamic libraries
6320 INFO: Looking for eggs
6321 INFO: Using Python library c:\python\python39.dll
6321 INFO: Found binding redirects:
[]
6325 INFO: Warnings written to C:\Users\Χρήστος\Desktop\radio\build\peradio2\warn-peradio2.txt
6359 INFO: Graph cross-reference written to C:\Users\Χρήστος\Desktop\radio\build\peradio2\xref-peradio2.html
6366 INFO: checking PYZ
6375 INFO: Building because toc changed
6375 INFO: Building PYZ (ZlibArchive) C:\Users\Χρήστος\Desktop\radio\build\peradio2\PYZ-00.pyz
6905 INFO: Building PYZ (ZlibArchive) C:\Users\Χρήστος\Desktop\radio\build\peradio2\PYZ-00.pyz completed successfully.
6912 INFO: checking PKG
6920 INFO: Building because toc changed
6920 INFO: Building PKG (CArchive) PKG-00.pkg
6940 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
6941 INFO: Bootloader c:\python\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
6942 INFO: checking EXE
6951 INFO: Rebuilding EXE-00.toc because peradio2.exe missing
6952 INFO: Building EXE from EXE-00.toc
7007 INFO: Copying icons from ['c:\\python\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
7071 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
7071 INFO: Writing RT_ICON 1 resource with 3752 bytes
7072 INFO: Writing RT_ICON 2 resource with 2216 bytes
7073 INFO: Writing RT_ICON 3 resource with 1384 bytes
7073 INFO: Writing RT_ICON 4 resource with 37019 bytes
7073 INFO: Writing RT_ICON 5 resource with 9640 bytes
7074 INFO: Writing RT_ICON 6 resource with 4264 bytes
7074 INFO: Writing RT_ICON 7 resource with 1128 bytes
7103 INFO: Appending archive to EXE C:\Users\Χρήστος\Desktop\radio\build\peradio2\peradio2.exe
7261 INFO: Building EXE from EXE-00.toc completed successfully.
7264 INFO: checking COLLECT
7264 INFO: Building COLLECT because COLLECT-00.toc is non existent
7265 INFO: Building COLLECT COLLECT-00.toc
7570 INFO: Building COLLECT COLLECT-00.toc completed successfully.
C:\Users\Χρήστος\Desktop\radio>pyinstaller --hidden-import=miniaudio peradio2.py
118 INFO: PyInstaller: 4.2
119 INFO: Python: 3.9.2
120 INFO: Platform: Windows-10-10.0.19041-SP0
121 INFO: wrote C:\Users\Χρήστος\Desktop\radio\peradio2.spec
123 INFO: UPX is not available.
130 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Χρήστος\\Desktop\\radio', 'C:\\Users\\Χρήστος\\Desktop\\radio']
144 INFO: checking Analysis
154 INFO: Building because hiddenimports changed
155 INFO: Initializing module dependency graph...
158 INFO: Caching module graph hooks...
165 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
169 INFO: Analyzing base_library.zip ...
2849 INFO: Processing pre-find module path hook distutils from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2849 INFO: distutils: retargeting to non-venv dir 'c:\\python\\lib'
4998 INFO: Caching module dependency graph...
5090 INFO: running Analysis Analysis-00.toc
5103 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\python\python.exe
5161 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\python\python39.dll
5373 INFO: Analyzing C:\Users\Χρήστος\Desktop\radio\peradio2.py
6202 INFO: Processing pre-find module path hook site from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
6203 INFO: site: retargeting to fake-dir 'c:\\python\\lib\\site-packages\\PyInstaller\\fake-modules'
8558 INFO: Processing pre-safe import module hook six.moves from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
11175 INFO: Processing module hooks...
11175 INFO: Loading module hook 'hook-pycparser.py' from 'c:\\python\\lib\\site-packages\\pyinstaller_hooks_contrib-2021.1-py3.9.egg\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
11177 INFO: Loading module hook 'hook-pytest.py' from 'c:\\python\\lib\\site-packages\\pyinstaller_hooks_contrib-2021.1-py3.9.egg\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Python\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\python\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 725, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 672, in build
exec(code, spec_namespace)
File "C:\Users\Χρήστος\Desktop\radio\peradio2.spec", line 6, in <module>
a = Analysis(['peradio2.py'],
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 242, in __init__
self.__postinit__()
File "c:\python\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 420, in assemble
self.graph.process_post_graph_hooks()
File "c:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 367, in process_post_graph_hooks
module_hook.post_graph()
File "c:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 447, in post_graph
self._load_hook_module()
File "c:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 408, in _load_hook_module
self._hook_module = importlib_load_source(
File "c:\python\lib\site-packages\PyInstaller\compat.py", line 598, in importlib_load_source
return mod_loader.load_module()
File "<frozen importlib._bootstrap_external>", line 469, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 969, in load_module
File "<frozen importlib._bootstrap_external>", line 794, in load_module
File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "c:\python\lib\site-packages\pyinstaller_hooks_contrib-2021.1-py3.9.egg\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-pytest.py", line 18, in <module>
import pytest
File "c:\python\lib\site-packages\pytest.py", line 8, in <module>
from _pytest.assertion import register_assert_rewrite
File "c:\python\lib\site-packages\_pytest\assertion\__init__.py", line 13, in <module>
from _pytest.assertion import rewrite
File "c:\python\lib\site-packages\_pytest\assertion\rewrite.py", line 24, in <module>
from _pytest.assertion import util
File "c:\python\lib\site-packages\_pytest\assertion\util.py", line 11, in <module>
import _pytest._code
File "c:\python\lib\site-packages\_pytest\_code\__init__.py", line 7, in <module>
from .code import Code # noqa
File "c:\python\lib\site-packages\_pytest\_code\code.py", line 15, in <module>
import pluggy
File "c:\python\lib\site-packages\pluggy\__init__.py", line 16, in <module>
from .manager import PluginManager, PluginValidationError
File "c:\python\lib\site-packages\pluggy\manager.py", line 6, in <module>
import importlib_metadata
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 471, in <module>
__version__ = version(__name__)
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 438, in version
return distribution(package).version
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 411, in distribution
return Distribution.from_name(package)
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 179, in from_name
dists = resolver(name)
File "<frozen importlib._bootstrap_external>", line 1389, in find_distributions
File "c:\python\lib\importlib\metadata.py", line 487, in find_distributions
found = cls._search_paths(context.name, context.path)
AttributeError: 'str' object has no attribute 'name'
C:\Users\Χρήστος\Desktop\radio>pyinstaller peradio2.py
118 INFO: PyInstaller: 4.2
118 INFO: Python: 3.9.2
119 INFO: Platform: Windows-10-10.0.19041-SP0
120 INFO: wrote C:\Users\Χρήστος\Desktop\radio\peradio2.spec
123 INFO: UPX is not available.
125 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Χρήστος\\Desktop\\radio', 'C:\\Users\\Χρήστος\\Desktop\\radio']
138 INFO: checking Analysis
141 INFO: Building because C:\Users\Χρήστος\Desktop\radio\peradio2.py changed
141 INFO: Initializing module dependency graph...
144 INFO: Caching module graph hooks...
151 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
155 INFO: Analyzing base_library.zip ...
2197 INFO: Processing pre-find module path hook distutils from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2197 INFO: distutils: retargeting to non-venv dir 'c:\\python\\lib'
5129 INFO: Caching module dependency graph...
5250 INFO: running Analysis Analysis-00.toc
5267 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\python\python.exe
5342 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\python\python39.dll
5538 INFO: Analyzing C:\Users\Χρήστος\Desktop\radio\peradio2.py
6348 INFO: Processing pre-find module path hook site from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
6351 INFO: site: retargeting to fake-dir 'c:\\python\\lib\\site-packages\\PyInstaller\\fake-modules'
8738 INFO: Processing pre-safe import module hook six.moves from 'c:\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
11357 INFO: Processing module hooks...
11357 INFO: Loading module hook 'hook-pycparser.py' from 'c:\\python\\lib\\site-packages\\pyinstaller_hooks_contrib-2021.1-py3.9.egg\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
11359 INFO: Loading module hook 'hook-pytest.py' from 'c:\\python\\lib\\site-packages\\pyinstaller_hooks_contrib-2021.1-py3.9.egg\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Python\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\python\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 725, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 672, in build
exec(code, spec_namespace)
File "C:\Users\Χρήστος\Desktop\radio\peradio2.spec", line 6, in <module>
a = Analysis(['peradio2.py'],
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 242, in __init__
self.__postinit__()
File "c:\python\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\python\lib\site-packages\PyInstaller\building\build_main.py", line 420, in assemble
self.graph.process_post_graph_hooks()
File "c:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 367, in process_post_graph_hooks
module_hook.post_graph()
File "c:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 447, in post_graph
self._load_hook_module()
File "c:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 408, in _load_hook_module
self._hook_module = importlib_load_source(
File "c:\python\lib\site-packages\PyInstaller\compat.py", line 598, in importlib_load_source
return mod_loader.load_module()
File "<frozen importlib._bootstrap_external>", line 469, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 969, in load_module
File "<frozen importlib._bootstrap_external>", line 794, in load_module
File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "c:\python\lib\site-packages\pyinstaller_hooks_contrib-2021.1-py3.9.egg\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-pytest.py", line 18, in <module>
import pytest
File "c:\python\lib\site-packages\pytest.py", line 8, in <module>
from _pytest.assertion import register_assert_rewrite
File "c:\python\lib\site-packages\_pytest\assertion\__init__.py", line 13, in <module>
from _pytest.assertion import rewrite
File "c:\python\lib\site-packages\_pytest\assertion\rewrite.py", line 24, in <module>
from _pytest.assertion import util
File "c:\python\lib\site-packages\_pytest\assertion\util.py", line 11, in <module>
import _pytest._code
File "c:\python\lib\site-packages\_pytest\_code\__init__.py", line 7, in <module>
from .code import Code # noqa
File "c:\python\lib\site-packages\_pytest\_code\code.py", line 15, in <module>
import pluggy
File "c:\python\lib\site-packages\pluggy\__init__.py", line 16, in <module>
from .manager import PluginManager, PluginValidationError
File "c:\python\lib\site-packages\pluggy\manager.py", line 6, in <module>
import importlib_metadata
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 471, in <module>
__version__ = version(__name__)
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 438, in version
return distribution(package).version
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 411, in distribution
return Distribution.from_name(package)
File "c:\python\lib\site-packages\importlib_metadata\__init__.py", line 179, in from_name
dists = resolver(name)
File "<frozen importlib._bootstrap_external>", line 1389, in find_distributions
File "c:\python\lib\importlib\metadata.py", line 487, in find_distributions
found = cls._search_paths(context.name, context.path)
AttributeError: 'str' object has no attribute 'name'
I tried to uninstall and then reinstall pyinstall six enum34 and setuptools but the error doesn't gone.
It's the first time i use miniaudio module.
Can anyone help me about?
Thanks in advance,
Chris Pappas
**Edit: ** I found that is not the only module about that problem.
pip uninstall importlib-metadata
pip install importlib-metadata
Fix the errors!!!
I had a very old version of this module 0.x . now 3.x
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 try to convert my .py file into an app using pyinstaller, I get the following output on terminal
Rishabhs-MacBook-Pro:desktop rishabhtatia$ pyinstaller --clean --hidden-
import tkinter test.py
697 INFO: PyInstaller: 3.3.1
697 INFO: Python: 3.6.4
709 INFO: Platform: Darwin-17.4.0-x86_64-i386-64bit
711 INFO: wrote /Users/rishabhtatia/Desktop/test.spec
714 INFO: UPX is not available.
716 INFO: Removing temporary files and cleaning cache in /Users/rishabhtatia/Library/Application Support/pyinstaller
Traceback (most recent call last):
File "/Users/rishabhtatia/anaconda3/bin/pyinstaller", line 11, in <module>
sys.exit(run())
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 94, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 737, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 162, in __init__
raise ValueError("script '%s' not found" % script)
ValueError: script '/Users/rishabhtatia/Desktop/test.py' not found
Rishabhs-MacBook-Pro:desktop rishabhtatia$ pyinstaller --clean --hidden-import tkinter typeMachine.py
314 INFO: PyInstaller: 3.3.1
314 INFO: Python: 3.6.4
321 INFO: Platform: Darwin-17.4.0-x86_64-i386-64bit
323 INFO: wrote /Users/rishabhtatia/Desktop/typeMachine.spec
326 INFO: UPX is not available.
327 INFO: Removing temporary files and cleaning cache in /Users/rishabhtatia/Library/Application Support/pyinstaller
328 INFO: Extending PYTHONPATH with paths
['/Users/rishabhtatia/Desktop', '/Users/rishabhtatia/Desktop']
328 INFO: checking Analysis
328 INFO: Building Analysis because out00-Analysis.toc is non existent
328 INFO: Initializing module dependency graph...
332 INFO: Initializing module graph hooks...
334 INFO: Analyzing base_library.zip ...
4406 INFO: Analyzing hidden import 'tkinter'
4576 INFO: running Analysis out00-Analysis.toc
4586 INFO: Caching module hooks...
4590 INFO: Analyzing /Users/rishabhtatia/Desktop/typeMachine.py
4827 INFO: Processing pre-safe import module hook six.moves
5525 INFO: Processing pre-find module path hook distutils
10217 INFO: Processing pre-find module path hook site
10218 INFO: site: retargeting to fake-dir '/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/fake-modules'
16738 INFO: Loading module hooks...
16738 INFO: Loading module hook "hook-pkg_resources.py"...
17122 INFO: Processing pre-safe import module hook win32com
17433 INFO: Loading module hook "hook-PyQt5.py"...
17628 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
17630 INFO: Loading module hook "hook-lib2to3.py"...
17633 INFO: Loading module hook "hook-_tkinter.py"...
17877 INFO: checking Tree
17877 INFO: Building Tree because out00-Tree.toc is non existent
17877 INFO: Building Tree out00-Tree.toc
17888 INFO: checking Tree
17888 INFO: Building Tree because out01-Tree.toc is non existent
17889 INFO: Building Tree out01-Tree.toc
17895 INFO: Loading module hook "hook-encodings.py"...
17973 INFO: Loading module hook "hook-PIL.py"...
17979 INFO: Excluding import 'PyQt4'
17981 INFO: Removing import of PyQt4 from module PIL.ImageQt
17981 INFO: Excluding import 'PySide'
17983 INFO: Removing import of PySide from module PIL.ImageQt
17983 INFO: Excluding import 'tkinter'
17985 INFO: Import to be excluded not found: 'FixTk'
17985 INFO: Excluding import 'PyQt5'
17987 INFO: Removing import of PyQt5.QtCore from module PIL.ImageQt
17987 INFO: Removing import of PyQt5.QtGui from module PIL.ImageQt
17987 INFO: Loading module hook "hook-setuptools.py"...
18020 INFO: Loading module hook "hook-pycparser.py"...
18279 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
18847 INFO: Loading module hook "hook-PIL.Image.py"...
19267 INFO: Loading module hook "hook-PyQt5.Qt.py"...
19269 INFO: Loading module hook "hook-pytest.py"...
20348 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
20349 INFO: Loading module hook "hook-sysconfig.py"...
Traceback (most recent call last):
File "/Users/rishabhtatia/anaconda3/bin/pyinstaller", line 11, in <module>
sys.exit(run())
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 94, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 737, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 213, in __init__
self.__postinit__()
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
self.assemble()
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 472, in assemble
module_hook.post_graph()
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/imphook.py", line 410, in post_graph
self._load_hook_module()
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/building/imphook.py", line 377, in _load_hook_module
self.hook_module_name, self.hook_filename)
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/compat.py", line 744, in importlib_load_source
return mod_loader.load_module()
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/rishabhtatia/anaconda3/lib/python3.6/site-packages/PyInstaller/hooks/hook-sysconfig.py", line 42, in <module>
hiddenimports = [sysconfig._get_sysconfigdata_name()]
TypeError: _get_sysconfigdata_name() missing 1 required positional argument: 'check_exists'
I've tried to use various different commands with pyinstaller and have tried using py2app with no success.
I'm currently using
python version: 3.6.4
anaconda version: 1.6.9
macOS HighSierra
Any help on how I can successfully convert this python file into an app will be appreciated! Thank you!
I came across the same problem. Upon further investigation, it seems to be the problem with Anaconda introducing breaking changes.
Please get in touch with the anaconda people then. We can not support their distribution any longer if they add incompatible changes.
I had the same issue before, changing the conda environment's python to 3.5.1 removed that error.
I had the same error (with anaconda as well), but only with python version 3.6.4. If I downgrade to 3.6.3, the error disappears.
If you experience this issue, update your conda installation. If this does not help, get in touch with the anaconda people. We can not support their distribution any longer if they add incompatible changes.
See https://github.com/pyinstaller/pyinstaller/issues/3192 for full discussion.
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.