Relative Content

Tag Archive for pythonpyinstaller

Why PyInstaller doesn’t see modules?

I’m trying to reproduce the example code of pySiril and compile it all into an exe file so that I can freely distribute my scripts for processing astrophotography.

PyInstaller doesn’t see modules

I’m trying to reproduce the example code of pySiril and compile it all into an exe file so that I can freely distribute my scripts for processing astrophotography. However, when starting the exe, an error appears that the module was not found.

Crypter build error when turning into an executable

I am turning the Crypter program into an executable with PyInstaller but when I click on Build it stops when trying to call PyInstaller. It works just fine when running Builder.pyw normally as not an executable but as python Builder.pyw. When running the cmd and running pyinstaller --version I get the right version coming back. I even did pip install pyinstaller==3.6 in the cmd so that it is the same version as the one in the program. As not an executable and running normally, I did use a virtual environment with the version modules seen in the requirements.txt file. The python version I am using is 3.7.0.

Error to make a Standalone Executable file

It is showing this error when I an creating standalone file.
Error is:
Traceback (most recent call last): File “C:UserskanhaAppDataLocalProgramsPythonPython310librunpy.py”, line 196, in run_module_as_main return run_code(code, main_globals, None, File “C:UserskanhaAppDataLocalProgramsPythonPython310librunpy.py”, line 86, in run_code exec(code, run_globals) File “C:UserskanhaPycharmProjectspythonProjectvenvScriptspyinstaller.exe_main.py”, line 7, in File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstaller_main.py”, line 228, in console_script_run run() File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstaller_main.py”, line 212, in run run_build(pyi_config, spec_file, **vars(args)) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstaller_main.py”, line 69, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerbuildingbuild_main.py”, line 1189, in main build(specfile, distpath, workpath, clean_build) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerbuildingbuild_main.py”, line 1129, in build exec(code, spec_namespace) File “C:UserskanhaPycharmProjectspythonProjectgui.spec”, line 4, in a = Analysis( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerbuildingbuild_main.py”, line 529, in init self.postinit() File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerbuildingdatastruct.py”, line 184, in postinit self.assemble() File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerbuildingbuild_main.py”, line 669, in assemble program_scripts.append(self.graph.add_script(script)) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerdependanalysis.py”, line 268, in add_script self._top_script_node = super().add_script(pathname) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1160, in add_script self._process_imports(n) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2591, in _process_imports target_modules = self._safe_import_hook(*import_info, **kwargs) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerdependanalysis.py”, line 437, in _safe_import_hook ret_modules = super()._safe_import_hook( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2048, in _safe_import_hook target_modules = self.import_hook( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1232, in import_hook target_package, target_module_partname = self._find_head_package( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1411, in _find_head_package target_package = self._safe_import_module( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerdependanalysis.py”, line 501, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1792, in _safe_import_module self._process_imports(n) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2591, in _process_imports target_modules = self._safe_import_hook(*import_info, **kwargs) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerdependanalysis.py”, line 437, in _safe_import_hook ret_modules = super()._safe_import_hook( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2048, in _safe_import_hook target_modules = self.import_hook( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1232, in import_hook target_package, target_module_partname = self._find_head_package( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1411, in _find_head_package target_package = self._safe_import_module( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerdependanalysis.py”, line 501, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 1791, in _safe_import_module n = self._scan_code(module, co, co_ast) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2386, in _scan_code self._scan_bytecode( File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphmodulegraph.py”, line 2490, in _scan_bytecode for inst in util.iterate_instructions(module_code_object): File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphutil.py”, line 13, in iterate_instructions yield from (i for i in dis.get_instructions(code_object) if i.opname != “EXTENDED_ARG”) File “C:UserskanhaPycharmProjectspythonProjectvenvlibsite-packagesPyInstallerlibmodulegraphutil.py”, line 13, in yield from (i for i in dis.get_instructions(code_object) if i.opname != “EXTENDED_ARG”) File “C:UserskanhaAppDataLocalProgramsPythonPython310libdis.py”, line 338, in _get_instructions_bytes argval, argrepr = _get_const_info(arg, constants) File “C:UserskanhaAppDataLocalProgramsPythonPython310libdis.py”, line 292, in _get_const_info argval = const_list[const_index] IndexError: tuple index out of range