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

Windows 2.2.0 install fails (Windows 10 Pro) #130

Closed
j-hickman opened this issue Apr 25, 2023 · 21 comments
Closed

Windows 2.2.0 install fails (Windows 10 Pro) #130

j-hickman opened this issue Apr 25, 2023 · 21 comments
Labels

Comments

@j-hickman
Copy link

j-hickman commented Apr 25, 2023

After a direct upgrade (msi) from 2.1.1 to 2.2.0, this error pops up:

Traceback (most recent call last):
  File "app\instawow_gui_wrapper\__main__.py", line 32, in <module>
  File "app\instawow_gui_wrapper\__main__.py", line 28, in main
  File "app_packages\loguru\_logger.py", line 1251, in catch_wrapper
  File "app_packages\click\core.py", line 1130, in __call__
  File "app_packages\click\core.py", line 1055, in main
  File "app_packages\click\core.py", line 1657, in invoke
  File "app_packages\click\core.py", line 1404, in invoke
  File "app_packages\click\core.py", line 760, in invoke
  File "app_packages\click\decorators.py", line 26, in new_func
  File "app_packages\instawow\cli.py", line 1209, in gui
  File "app_packages\instawow_gui\app.py", line 23, in __init__
  File "app_packages\toga\app.py", line 323, in __init__
  File "app_packages\toga\platform.py", line 73, in get_platform_factory
RuntimeError: No Toga backend could be loaded.

I suspect there's a missing dependency not in the msi package for 2.2.0

@layday
Copy link
Owner

layday commented Apr 25, 2023

I can't repro this. Could you try uninstalling and reinstalling? The dependencies are all there.

@j-hickman
Copy link
Author

Yes, I tried a full uninstall and reinstall using the 2.2.0 msi. I reinstalled 2.1.1 and it works fine.

@j-hickman
Copy link
Author

j-hickman commented Apr 28, 2023

I also tried 2.3.0 (latest release) and it has identical errors (but different line numbers for those errors) to this issue.

Traceback (most recent call last):
  File "app\instawow_gui_wrapper\__main__.py", line 32, in <module>
  File "app\instawow_gui_wrapper\__main__.py", line 28, in main
  File "app_packages\loguru\_logger.py", line 1251, in catch_wrapper
  File "app_packages\click\core.py", line 1130, in __call__
  File "app_packages\click\core.py", line 1055, in main
  File "app_packages\click\core.py", line 1657, in invoke
  File "app_packages\click\core.py", line 1404, in invoke
  File "app_packages\click\core.py", line 760, in invoke
  File "app_packages\click\decorators.py", line 26, in new_func
  File "app_packages\instawow\cli.py", line 1212, in gui
  File "app_packages\instawow_gui\app.py", line 23, in __init__
  File "app_packages\toga\app.py", line 323, in __init__
  File "app_packages\toga\platform.py", line 73, in get_platform_factory
RuntimeError: No Toga backend could be loaded.

@layday
Copy link
Owner

layday commented Apr 28, 2023

Could you please check if there is a toga_winforms-0.3.1.dist-info folder in app_packages? It should have an entry_points.txt inside.

@j-hickman
Copy link
Author

image

The directory appears to be there, but entry_points.txt is not.

@layday
Copy link
Owner

layday commented Apr 28, 2023

That's "toga-0.3.1.dist-info"; we are looking for "toga_winforms-0.3.1.dist-info" :)

@j-hickman
Copy link
Author

Yes, contents are:

[toga.backends]
windows = toga_winforms

@layday
Copy link
Owner

layday commented Apr 28, 2023

Just to understand this a little better, you launch instawow-gui.exe and then that error pops up on the screen - where? In an alert?

@j-hickman
Copy link
Author

Starting the app (yes, instawow-gui.exe) the error pops up in an application dialog box:

image

Then closes, it never properly starts.

@j-hickman
Copy link
Author

Of note, in case this comes up, I also tried right clicking on the MSI and doing a repair. It didn't resolve the issue (for 2.2.0 or 2.3.0).

@layday
Copy link
Owner

layday commented Apr 28, 2023

Could you give the version from https://github.com/layday/instawow/actions/runs/4833972401 a shot?

@j-hickman
Copy link
Author

Sure, tried it. No change, same error. If there's a way to turn on debugging for you and provide you the result, I can do that as well.

@layday
Copy link
Owner

layday commented Apr 28, 2023

You might be able to find a more complete stack trace in %APPDATA%/Roaming/instawow/profiles/__jsonrpc__/error.log.

@j-hickman
Copy link
Author

2023-04-28 11:25:17.375 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (33416), thread 'MainThread' (35560):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1209, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.
2023-04-28 11:26:50.978 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (22440), thread 'MainThread' (33936):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1209, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.
2023-04-28 11:27:56.426 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (33232), thread 'MainThread' (30188):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.
2023-04-28 11:41:05.423 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (19876), thread 'MainThread' (39364):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.
2023-04-28 12:20:52.350 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (38116), thread 'MainThread' (40464):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.

@j-hickman
Copy link
Author

I did find the log, as you can see above, but it doesn't seem to contain anything useful as far as I can tell.

@layday
Copy link
Owner

layday commented Apr 29, 2023

Could you try the version from https://github.com/layday/instawow/actions/runs/4838097274? It'll log a few more things in your error.log that should hopefully help with debugging the issue.

@j-hickman
Copy link
Author

Interesting detail this time and I can at least confirm the log is correct:

2023-05-01 09:39:42.297 | INFO | instawow.cli:gui:1215 - sys.path=['C:\Users\J\AppData\Local\Programs\layday\instawow-gui\python310.zip', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app_packages', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app']
2023-05-01 09:39:42.297 | INFO | instawow.cli:gui:1216 - sys.meta_path=[<class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>]
2023-05-01 09:39:42.301 | INFO | instawow.cli:gui:1217 - entry_points()={'console_scripts': [EntryPoint(name='alembic', value='alembic.config:main', group='console_scripts')], 'distutils.setup_keywords': [EntryPoint(name='cffi_modules', value='cffi.setuptools_ext:cffi_modules', group='distutils.setup_keywords')], 'pyinstaller40': [EntryPoint(name='hook-dirs', value='rapidfuzz.__pyinstaller:get_hook_dirs', group='pyinstaller40'), EntryPoint(name='tests', value='rapidfuzz.__pyinstaller:get_PyInstaller_tests', group='pyinstaller40')], 'pytest11': [EntryPoint(name='anyio', value='anyio.pytest_plugin', group='pytest11')]}
2023-05-01 09:39:42.306 | INFO | instawow.cli:gui:1218 - entry_points(group="toga.backends")=[]
2023-05-01 09:39:42.306 | INFO | instawow.cli:gui:1224 - toga_winforms.files=None
2023-05-01 09:39:42.306 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (2180), thread 'MainThread' (4120):
Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper_main_.py", line 32, in

File "app\instawow_gui_wrapper_main_.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1226, in gui

File "pathlib.py", line 1134, in read_text

File "pathlib.py", line 1119, in open

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app_packages\toga_winforms-0.3.0.dev36.dist-info\entry_points.txt'

I checked that directory and confirmed there is no file with that name:

image

@layday
Copy link
Owner

layday commented May 1, 2023

So you've got two toga_winforms-<version>.dist-info folders side by side? That would seem to point to an uninstallation....hiccup. Could you try uninstalling instawow and deleting %APPDATA/Local/Programs/layday before reinstalling? I guess Python's picking up the first metadata folder alphabetically which is for the older toga_winforms version.

@j-hickman
Copy link
Author

I agree. I looked through the installed apps on the system and an uninstall does not perform the typical uninstall via Windows Apps uninstall, so it looks like there were 5 installed versions of the app on my system (despite it being a reinstall). I went through and removed each version and then removed the %APPDATA/Local/Programs/layday folder as requested. I then reinstalled the version you provided and that fixed the issue.

My guess, based on this data, is that uninstall doesn't correctly follow the Windows installer uninstall process and it is leaving folders as well to later trip up future updates of the app.

@layday layday added the gui label May 2, 2023
@layday
Copy link
Owner

layday commented May 2, 2023

What I assume happened is that an old upgrade failed, and since that particular folder wasn't in any of the newer installers' manifests, it just stayed there until it tripped up the new backend finder in the latest version of toga, which depends on the presence of entry_points.txt. I (briefly) discussed this with the developers of the upstream library and we can't definitively say why dist-info was cleared out but the uninstaller failed to delete the folder. Perhaps instawow was running at the time and had a handle on the folder? Maybe the uninstaller was interrupted? Not sure. I suppose it'd be better if the uninstaller were to simply delete everything under "layday/instawow"; I'd have to look into how to configure it to do that.

@layday
Copy link
Owner

layday commented May 2, 2023

Also opened python/importlib_metadata#457 to avoid silent failures like we've seen here.

@layday layday closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants