ParthJadhav / Tkinter-Designer

An easy and fast way to create a Python GUI 🐍
BSD 3-Clause "New" or "Revised" License
8.63k stars 794 forks source link

Report bug: Frame not found in figma file or is empty. #341

Open Sxri opened 1 year ago

Sxri commented 1 year ago

It makes one element then fails. Here is the full error I get:

Creating Element { name: image, type: rectangle } Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\lurk\Tkinter-Designer\tkdesigner\designer.py", line 21, in to_code frame = Frame(f, self.figma_file, self.output_path, self.frameCounter) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lurk\Tkinter-Designer\tkdesigner\figma\frame.py", line 29, in init self.elements = [ ^ File "C:\Users\lurk\Tkinter-Designer\tkdesigner\figma\frame.py", line 30, in self.create_element(child) File "C:\Users\lurk\Tkinter-Designer\tkdesigner\figma\frame.py", line 78, in create_element download_image(image_url, image_path) File "C:\Users\lurk\Tkinter-Designer\tkdesigner\utils.py", line 20, in download_image response = requests.get(url) ^^^^^^^^^^^^^^^^^ File "C:\Users\lurk\venv\Lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lurk\venv\Lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\liamb\venv\Lib\site-packages\requests\sessions.py", line 528, in request prep = self.prepare_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lurk\venv\Lib\site-packages\requests\sessions.py", line 456, in prepare_request p.prepare( File "C:\Users\lurk\venv\Lib\site-packages\requests\models.py", line 316, in prepare self.prepare_url(url, params) File "C:\Users\lurk\venv\Lib\site-packages\requests\models.py", line 390, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\lurk\AppData\Local\Programs\Python\Python311\Lib\tkinter__init.py", line 1948, in call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "C:\Users\lurk\Tkinter-Designer\gui\gui.py", line 72, in btn_clicked designer.design() File "C:\Users\lurk\Tkinter-Designer\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "C:\Users\lurk\Tkinter-Designer\tkdesigner\designer.py", line 23, in to_code raise Exception("Frame not found in figma file or is empty") Exception: Frame not found in figma file or is empty

aellas commented 12 months ago

You need to add a frame to your figma file https://help.figma.com/hc/en-us/articles/360039832054-Frames-and-Groups

Create a frame: macOS: Command-Option-G Windows: Control + Alt + G

Then place everything into the frame

Example:

image
lutfipati96 commented 9 months ago

is there a solution to this? I have followed the rules. but the problem is the same.

vincentperezzz commented 8 months ago

Creating Element { name: rectangle, type: rectangle } Creating Element { name: this is a test, type: text } Creating Element { name: button, type: group } Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\designer.py", line 21, in to_code frame = Frame(f, self.figma_file, self.output_path, self.frameCounter) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\figma\frame.py", line 29, in init self.elements = [ ^ File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\figma\frame.py", line 30, in self.create_element(child) File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\figma\frame.py", line 51, in create_element download_image(image_url, image_path) File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\utils.py", line 23, in download_image im = im.resize((im.size[0] // 2, im.size[1] // 2), Image.ANTIALIAS)
^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64qbz5n2kfra8p0\Lib\tkinter\init.py", line 1948, in call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\gui\gui.py", line 72, in btn_clicked designer.design() File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "C:\Users\Vincent Perez\Desktop\Tkinter-Designer-master\tkdesigner\designer.py", line 23, in to_code raise Exception("Frame not found in figma file or is empty") Exception: Frame not found in figma file or is empty

barandenizdogan commented 8 months ago

Read the Install Instructions carefully. You should do following steps. 1- pip install tkdesigner Thats gonna fix all the problems. Clonnig repo and installing requirements not enough.

taisecrets2002 commented 7 months ago

had the same problem. TkDesigner isn't compatible with the newest version of pillow that runs on python 3.12. I solved this by simply getting Python 3.10 and downloading tkdesigner on it and then running the gui.py in python 3.10 (in my case in windows I simply did this in my terminal: Tkinter-Designer-master\gui> py -3.10 gui.py I work in VS Code and windows so my solution may differ over different OS.