Pyinstaller ошибка ModuleNotFound [closed]
Closed 1 min ago.
How to programmatically change the analysis path in the spec file
I am tweaking the Crypter program and it builds using pyinstaller. I am turning it into an executable however it runs fine when running normally not as an executable but as a one file executable using pyinstaller it comes up with this error.
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
Make pyinstaller app open in separate non-terminal cli
I made a chatbot program in python, converted it to an EXE file, and the CLI opens in a terminal window. Is there a way to make it open in a custom CLI instead of a terminal window?
Pyinstaller cannot detect C-module in package
I’m using pyinstaller to create an executable file from python script to run on Windows.
My python script does depend on a package that compiled from C-module. Package’s name is MT5Manager, if you want to try.
I run script standalone without any error by python main.py
. But I retrieve error when I run by .exe file.
Program runs sucessfully in pycharm but errors when running EXE generated by pyinstaller
I have a program that takes all excel files in a folder and combines them into one master file. It runs without any errors in pycharm but will give this error when I try and run the .exe file generated by pyinstaller.
Error converting .py file into .exe using pyinstaller
“Pyinstaller –name NAME –onefile –windowed python.py”
The above command is used to convert a .py file into a .exe file. The above command gets executed and the .exe file is found inside the dist folder.
Python duplication after pyinstaller
I’m converting my python script to an exe using pyinstaller –onefile -w script.py.
However, after the conversion I tried to run the script but it duplicates itself multiple times.
pyinstaller error, making .exe file with web crawler (FileNotFoundError : [Errno 2])
what I want :