Ki-nTree
Ki-nTree copied to clipboard
AttributeError: 'Page' object has no attribute 'window'
I tried to run the current main branch and I got:
I am running KDE Neon (technically it is a 22.04 Ubuntu), all requirements were installed with pip -r Flet version is 0.22.1
Any advice would be recommended!
Could you please add which version of Ki-nTree you are using and any output which is generated in the (python) console you are running Ki-nTree from?
here is the command line output:
[INFO] TEMPLATE "internal_part_number.yaml" configuration file contains the following keys which are NOT in your user settings: {'IPN_USE_MANUFACTURER_PART_NUMBER'}
[INFO] TEMPLATE "general.yaml" configuration file contains the following keys which are NOT in your user settings: {'CHECK_EXISTING'}
[INFO] TEMPLATE "supplier_parameters.yaml" configuration file contains the following keys which are NOT in your user settings: {'Passives', 'Base'}
[INFO] TEMPLATE "suppliers.yaml" configuration file contains the following keys which are NOT in your user settings: {'Jameco', 'AutomationDirect'}
package:media_kit_libs_linux registered.
Unhandled error processing page session : Traceback (most recent call last):
File "/home/mm/.local/lib/python3.10/site-packages/flet_runtime/app.py", line 242, in on_session_created
await asyncio.get_running_loop().run_in_executor(
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 46, in kintree_gui
init_gui(page)
File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 29, in init_gui
page.window.icon = os.path.join(settings.PROJECT_DIR, 'gui', 'logo.ico')
AttributeError: 'Page' object has no attribute 'window'
I am trying it with the code in the main branch. The 1.1.3 loads, however I needed to remove the .config/kintree folder as it failed with:
mm@P15:~/Projektek/inventree2/Ki-nTree$ python kintree_gui.py
[INFO] TEMPLATE "internal_part_number.yaml" configuration file contains the following keys which are NOT in your user settings: {'IPN_USE_MANUFACTURER_PART_NUMBER'}
[INFO] TEMPLATE "general.yaml" configuration file contains the following keys which are NOT in your user settings: {'CHECK_EXISTING'}
[INFO] TEMPLATE "supplier_parameters.yaml" configuration file contains the following keys which are NOT in your user settings: {'Base', 'Passives'}
[INFO] TEMPLATE "suppliers.yaml" configuration file contains the following keys which are NOT in your user settings: {'AutomationDirect', 'Jameco'}
package:media_kit_libs_linux registered.
Unhandled error processing page session : Traceback (most recent call last):
File "/home/mm/.local/lib/python3.10/site-packages/flet_runtime/app.py", line 242, in on_session_created
await asyncio.get_running_loop().run_in_executor(
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 48, in kintree_gui
inventree_settings_view = InvenTreeSettingsView(page)
File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/views/settings.py", line 922, in __init__
super().__init__(page)
File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/views/settings.py", line 358, in __init__
self.fields[field_name].value = self.settings[field_data[0]]
KeyError: 'IPN_USE_MANUFACTURER_PART_NUMBER'
I would like to do some developments so getting main working would be my goal.
@martonmiklos Flet version is incorrect, how do you install Ki-nTree?
Flet version is now at 0.24.1: flet = "^0.24.1"
@eeintech I installed the reqiurements with pip install -r requirements.txt
In the current main the Flet is set to:
Flet>=0.22.0,<0.23.0
https://github.com/sparkmicro/Ki-nTree/blob/main/requirements.txt#L3C1-L3C21
Manually altering the requirements and installing Flet 0.24.1 get the thing working.
Many thanks for the quick support!
Shall I file a PR on the requirements.txt?
@martonmiklos Good point, I will just keep this ticket opened until requirements.txt file is fixed, thanks!