0

我正在尝试将我的转换.py.exe.
但是,使用auto-py-to-exe. 第一条错误消息如下:

UPX is not available.

第二条错误消息如下:

An error occurred while packaging.

第二条消息导致“项目输出将不会移动到输出文件夹。
相关错误:

    266710 INFO: PyInstaller: 5.0.dev0
    266725 INFO: Python: 3.9.1
    266746 INFO: Platform: Windows-10-10.0.19041-SP0
    266765 INFO: wrote C:\Users\Public\Documents\ESTsoft\CreatorTemp\tmpgijz11tp\Seming Teacher's Reading Master.spec
    266784 INFO: UPX is not available.
    An error occurred while packaging
    Traceback (most recent call last):
      File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
        run_pyinstaller()
      File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\__main__.py", line 114, in run
        run_build(pyi_config, spec_file, **vars(args))
      File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
        PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
      File "c:\users\user\appdata\local\programs\python\python39\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:\users\user\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 669, in build
        code = compile(f.read(), spec, 'exec')
      File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\tmpgijz11tp\Seming Teacher's Reading Master.spec", line 26
        name='Seming Teacher's Reading Master',
                             ^
    SyntaxError: invalid syntax

Project output will not be moved to output folder.
4

1 回答 1

1

UPX用于进一步压缩您的 exe,是可选的

压缩的可执行程序包含在 UPX 启动代码中,该代码在启动程序时动态解压缩程序。

有关这方面的更多信息,请参阅此内容。

但是如果你不关心这个,那么--noupx在你的命令中添加标志,它会明确告诉你pyinstaller不要使用它

现在,对于第二个错误,它是由于您的 python 文件中的语法错误引起的,如此处所示

name='Seming Teacher's Reading Master'

您将需要对整个字符串使用更高的引号,因为您将单引号作为字符串的一部分,将其更改为类似

name="Seming Teacher's Reading Master"

那应该消除错误。

于 2021-01-18T08:09:25.100 回答