Tkinter-Designer icon indicating copy to clipboard operation
Tkinter-Designer copied to clipboard

KeyError: 'document'

Open aditdesai opened this issue 2 years ago • 5 comments

Traceback (most recent call last): File "c:\users\adit\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\adit\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\Adit\AppData\Local\Programs\Python\Python38-32\Scripts\tkdesigner.exe_main.py", line 7, in File "c:\users\adit\appdata\local\programs\python\python38-32\lib\site-packages\tkdesigner\cli.py", line 71, in main designer.design() File "c:\users\adit\appdata\local\programs\python\python38-32\lib\site-packages\tkdesigner\designer.py", line 29, in design code = self.to_code() File "c:\users\adit\appdata\local\programs\python\python38-32\lib\site-packages\tkdesigner\designer.py", line 21, in to_code window_data = self.file_data["document"]["children"][0]["children"][0] KeyError: 'document'

This is the error I get when I run tkdesigner FILE_ID TOKEN

  • Python is added to PATH
  • pip install tkdesigner has already been run
  • pip is up to date
  • I have followed naming conventions (as far as I know)

File URL: https://www.figma.com/file/1Dd7aygqhMcCRYwtinm6Oi/File-Converter?node-id=2%3A2

image

aditdesai avatar Apr 02 '22 14:04 aditdesai

hey @aditdesai

i see you have python installed but your running in it wrong directory mate.

open a fresh terminal or cmd and run these commands in order:

git clone https://github.com/ParthJadhav/Tkinter-Designer.git cd tkinter-designer pip3 install -r requirements.txt pip3 install tkdesigner cd tkinter-designer (optional: only if u arent still in tkinter-designer directory after the pip3 steps) cd gui python3 gui.py

abdulkadirhuzeifa avatar Apr 24 '22 14:04 abdulkadirhuzeifa

@aditdesai did @AbdulkadirH5253 's comment help you? If yes, then you can close this issue.

ParthJadhav avatar May 13 '22 16:05 ParthJadhav

Hey, I am seeing this issue as well

pshiri avatar Jun 08 '22 02:06 pshiri

Same error here.

allanjonis avatar Aug 06 '22 18:08 allanjonis

Hi, I've followed those steps that @AbdulkadirH5253 mentioned above. But this error occurs when I run gui.py, not sure why: window_data = self.file_data["document"]["children"][0]["children"][0] KeyError: 'document'

Update I found I entered the wrong token.

  • Press 'Enter' after adding a new token and copy the key.
  • Paste this key in gui.py
  • Will create a 'build' folder at the directory.

sam31046 avatar Sep 25 '22 12:09 sam31046