Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeze | KeyError SETTINGS['app_name'] #51

Closed
bicarlsen opened this issue Nov 19, 2018 · 17 comments
Closed

freeze | KeyError SETTINGS['app_name'] #51

bicarlsen opened this issue Nov 19, 2018 · 17 comments

Comments

@bicarlsen
Copy link

I am trying to freeze my project but am receiving a KeyError for SETTINGS[app_name].

Traceback (most recent call last):
  File "C:\Users\lspmpc\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\lspmpc\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\__main__.py", line 4, in <module>
    main()
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\cmdline.py", line 25, in main
    args.fn(*fn_args)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\builtin_commands\__init__.py", line 73, in freeze
    freeze_windows(debug=debug)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\freeze\windows.py", line 21, in freeze_windows
    run_pyinstaller(pyinstaller_args + extra_pyinstaller_args, debug)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\freeze\__init__.py", line 9, in run_pyinstaller
    app_name = SETTINGS['app_name']
KeyError: 'app_name'

From the src folder I am running python -m fbs freeze. I have tried this with a fresh project *created with python -m fbs startproject, with the same result. I checked the src/build/settings.base.json file, and everything seems correct.

I am on a Windows 10 machine with Python 3.6.5

Thank you

@mherrmann
Copy link
Owner

Hi. You should not be inside the src folder, but one directory above it when you do python -m fbs freeze.

@bicarlsen
Copy link
Author

bicarlsen commented Nov 19, 2018

When I do it from the folder above I get the error

Traceback (most recent call last):
  File "C:\Users\lspmpc\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\lspmpc\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\__main__.py", line 4, in <module>
    main()
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\cmdline.py", line 25, in main
    args.fn(*fn_args)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\builtin_commands\__init__.py", line 73, in freeze
    freeze_windows(debug=debug)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\freeze\windows.py", line 21, in freeze_windows
    run_pyinstaller(pyinstaller_args + extra_pyinstaller_args, debug)
  File "C:\Users\lspmpc\Anaconda3\lib\site-packages\fbs\freeze\__init__.py", line 23, in run_pyinstaller
    run(cmdline, check=True)
  File "C:\Users\lspmpc\Anaconda3\lib\subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\lspmpc\Anaconda3\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\lspmpc\Anaconda3\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

@mherrmann
Copy link
Owner

Please try again with vanilla Python 3.5, not Anaconda.

@mherrmann mherrmann reopened this Nov 19, 2018
@mherrmann
Copy link
Owner

@bicarlsen does the problem still occur when you don't use Anaconda?

@bicarlsen
Copy link
Author

I get the same error when running with plain Python, using both Python 3.6.5 and 3.5.4.

@mherrmann
Copy link
Owner

Thanks. What do you get when you do

pip freeze

?

@bicarlsen
Copy link
Author

fbs==0.4.2

@mherrmann
Copy link
Owner

You have failed to follow this step mentioned in both the tutorial and the Manual:

pip install fbs PyQt5==5.9.2 PyInstaller==3.4

@bicarlsen
Copy link
Author

Thank you. When I switched to plain Python I forgot to install those things. However I am now receiving the error

Traceback (most recent call last):
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\__main__.py", line 36, in <module>
    main()
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\cmdline.py", line 28, in main
    fn(*args)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\builtin_commands\__init__.py", line 103, in freeze
    freeze_windows(debug=debug)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\freeze\windows.py", line 24, in freeze_windows
    _add_missing_dlls()
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\freeze\windows.py", line 47, in _add_missing_dlls
    _add_missing_dll(dll_name)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\freeze\windows.py", line 70, in _add_missing_dll
    copy(_find_on_path(dll_name), freeze_dir)
  File "C:\Users\lspmpc\AppData\Local\Programs\Python\Python35\lib\site-packages\fbs\freeze\windows.py", line 86, in _find_on_path
    raise LookupError("Could not find %s on PATH" % file_name)
LookupError: Could not find msvcr110.dll on PATH

pip freeze gives me

altgraph==0.16.1
fbs==0.4.2
future==0.17.1
macholib==1.11
pefile==2018.8.8
PyInstaller==3.4
PyQt5==5.9.2
pywin32-ctypes==0.2.0
sip==4.19.8

@mherrmann
Copy link
Owner

mherrmann commented Nov 20, 2018

Does it work when you install this: https://www.microsoft.com/en-us/download/details.aspx?id=30679 ?

@bicarlsen
Copy link
Author

I get the same error.

@mherrmann
Copy link
Owner

Thanks. After installing my above link, do you have msvcr110.dll somewhere on your system? (Eg. if you search your C:\ drive with Windows Explorer for this file.)

@bicarlsen
Copy link
Author

Firstly, thank you very much for all your help, and your quick responses.

Yes, it is located at C:\Windows\SysWOW64\

@fredrikaverpil
Copy link
Contributor

fredrikaverpil commented Nov 21, 2018

This is probably not the best solution for you, in this thread, but I figured it could be worth me mentioning that I solved all of my "missing DLL" issues by installing miniconda and having its install directory on PATH.

@mherrmann
Copy link
Owner

Thank you Fredrik. I'm surprised @bicarlsen's C:\Windows\SysWOW64\ isn't on the PATH. Can you add it @bicarlsen?

@bicarlsen
Copy link
Author

Woop! That fixed it :)

Just, to summarize on the main issues , and how they were resolved:

  1. FileNotFoundError: [WinError 2] The system cannot find the file specified solved by using Vanilla Python instead of Anaconda, and ensuring that PyQt and PyInstaller were installed
  2. LookupError: Could not find msvcr110.dll on PATH solved by downloading Visual C++ Redistributable for Visual Studio 2012 Update 4 and ensuring the folder is in the PATH.

PS
I'm receiving another error now, but it is unrelated, so I will start another thread

@fredrikaverpil
Copy link
Contributor

For what it's worth, I also do not have C:\Windows\SysWOW64 on PATH.

I guess I don't run enough 32-bit applications on my otherwise 64-bit system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants