使用 autopytoexe 时出现权限被拒绝的问题

问题描述 投票:0回答:1

我正在尝试将 python 文件转换为 .exe,但我系统地收到以下错误:

    An error occurred while packaging
Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
    run_pyinstaller()
  File "c:\program files\python37\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\program files\python37\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\program files\python37\lib\site-packages\PyInstaller\building\build_main.py", line 720, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\program files\python37\lib\site-packages\PyInstaller\building\build_main.py", line 667, in build
    exec(code, spec_namespace)
  File "C:\Users\NAME\AppData\Local\Temp\tmpfe6m2e7t\myprog.spec", line 37, in <module>
    name='myprog')
  File "c:\program files\python37\lib\site-packages\PyInstaller\building\api.py", line 701, in __init__
    self.__postinit__()
  File "c:\program files\python37\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "c:\program files\python37\lib\site-packages\PyInstaller\building\api.py", line 745, in assemble
    shutil.copy(fnm, tofnm)
  File "c:\program files\python37\lib\shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "c:\program files\python37\lib\shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
PermissionError: [Errno 13] Permission denied: 'config\\SOFTWARE'

我尝试以管理员身份启动 autopytoexe,并将文件移至另一个目录,但这没有改变任何内容。 我还尝试转换其他(更基本的)文件并且转换工作正常,所以问题可能来自我正在使用的模块? (我自己写的matplotlib、scipy、numpy等也是基于这三个模块)

如果有人知道可能导致此问题的原因以及如何解决它......

非常感谢!

python exe data-conversion auto-py-to-exe
1个回答
0
投票

该问题并未给出错误的完整视图。就像@esqew提到的,请向我们提供完整的代码来看看这个。

© www.soinside.com 2019 - 2024. All rights reserved.