0
python v3.6.8
PyInstaller v3.6
auto-py-to-exe v2.7.5
os: windows 7

Command:

pyinstaller --noconfirm --onedir --console --name "MyMainapp" --key "qXx53d02m2PrswB1" --debug "all"  "<Script Location>"

When I want to convert a python file to exe (using auto-py-to-exe), these errors are shown to me:

An error occurred while packaging
Traceback (most recent call last):
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
    run_pyinstaller()
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
    exec(code, spec_namespace)
  File "C:\Users\Nima\AppData\Local\Temp\tmp8t9th72t\MyMainapp.spec", line 17, in <module>
    noarchive=True)
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 244, in __init__
    self.__postinit__()
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 500, in assemble
    for name, path, typecode in compile_py_files(new_toc, CONF['workpath']):
  File "c:\users\nima\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\utils\misc.py", line 152, in compile_py_files


      with open(obj_fnm, 'rb') as fh:
    FileNotFoundError: [Errno 2] No such file or directory: '-'



Project output will not be moved to output folder

Complete.

if someone knows something, please help me! thank you.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
Nima
  • 21
  • 1
  • 4
  • Show us the code for how `obj_fnm` is being set before this. – Alex F Jul 24 '20 at 15:48
  • @AlexF I did not set `obj_fnm`. this error is given from inside the module files! [desired file in github](https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/utils/misc.py) , code lines: 156 and 190 – Nima Jul 24 '20 at 16:31
  • 1
    Reading https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html is always a good idea. – Eric Mathieu Jul 24 '20 at 22:17
  • On the off chance that a solution has not been found, here's a related [GitHub Issue thread](https://github.com/pyinstaller/pyinstaller/issues/4034) that seems to point to this bug being resolved. – gallen Dec 17 '20 at 05:33

1 Answers1

-3

please use the command prompt(terminal) as run as administrator happy coding

  • Can you provide example or explanation why running as administrator is the answer to this question? This feels very similar to "Just use `sudo`" for Linux, which is generally considered a poor solution. – gallen Dec 17 '20 at 05:31