N
N
nickname_aboba2021-11-12 15:42:55
Building projects
nickname_aboba, 2021-11-12 15:42:55

Python does not work in exe (pyinstaller) how to solve?

when i convert file to exe it gives me this
171 INFO: PyInstaller: 4.7
171 INFO: Python: 3.9.6
187 INFO: Platform: Windows-10-10.0.19043-SP0
187 INFO: wrote C:\Users\Admin\ Desktop\1\token.spec
203 INFO: UPX is not available.
203 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Admin\\Desktop\\1']
and then this
Traceback (most recent call last):
File "c:\users\admin\appdata\local\programs \python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\admin\appdata\local\programs\python\python39\lib\runpy.py ", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Scripts\pyinstaller.exe\__main__.py", line 7, in
File "c:\users\admin\appdata\local\programs\python \python39\lib\site-packages\PyInstaller\__main__.py", line 124, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\admin\appdata\local\programs\python \python39\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\admin\appdata\local\ programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw. get('clean_build'))
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
exec(code, spec_namespace)
File "C:\ Users\Admin\Desktop\1\token.spec", line 7, in
a = Analysis(['token.py'],
File "c:\users\admin\appdata\local\programs\python\python39\lib\ site-packages\PyInstaller\building\build_main.py", line 245, in __init__
self.hookspath += discover_hook_directories()
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages \PyInstaller\building\build_main.py", line 102, in discover_hook_directories
output = exec_statement(
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 91, in exec_statement
return __exec_statement(statement, capture_stdout=True)
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 75, in __exec_statement
return __exec_python_cmd(cmd, capture_stdout=capture_stdout)
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 66, in __exec_python_cmd
txt = compat.exec_python(*cmd, env=pp_env)
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\compat.py", line 546, in exec_python
return exec_command(*cmdargs, **kwargs)
File "c:\users\admin\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\compat.py", line 332, in exec_command
out = proc .communicate(timeout=60)[0]
File "c:\users\admin\appdata\local\programs\python\python39\lib\subprocess.py", line 1134, in communicate
stdout, stderr = self._communicate(input , endtime, timeout)
File "c:\users\admin\appdata\local\programs\python\python39\lib\subprocess.py", line 1510, in _communicate
raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command '('c:\\users\\admin\\appdata\\local\\programs\\python\\python39\\python.exe', '-c', '\nimport sys\nimport pkg_resources \n\nentry_points = pkg_resources.iter_entry_points(\'pyinstaller40\', \'hook-dirs\')\nfor entry_point in entry_points:\n try:\n hook_dirs = entry_point.load()()\n for hook_dir in hook_dirs :\n print(\'\\n$_pyi:\' + hook_dir + \'*\')\n except Exception as e:\n print("discover_hook_directories: Failed to process hook entry point \'%s\' : %s" %\n (entry_point, e), file=sys.stderr)\n')' timed out after 60 seconds
.py file works fine

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
VMoreno, 2021-12-25
@VMoreno

Try to rename the source file, for example, to aaa_token.py and try to convert the already renamed file to exe again.
I just struggled with the same problem, on the copy.py and insert.py files, pyinstaller hung at the Extending PYTHONPATH with paths stage, and then fell out with a timeout like yours.
Reproduced on different configurations of python and Windows.
The only thing that worked for me was renaming the file.

A
Alexander, 2015-02-26
@zuba

everything can be done without js

R
rmaksim, 2015-02-27
@rmaksim

you can do it without zhs (see the answer above), but suddenly it is necessary with zhs) is
it necessary?
and what exactly do you want to fix that
1. so that the frame is after the hover?
2. or so that there is no pointing?
and the frame is there because the background hangs on the diva and the picture without src is inserted inside the
browser itself and means that there "is a picture"
on hover, the src of the picture is placed, and so on. the picture is already "as it is" - the browser removes its "designation"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question