question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TCLError -style - Failed to create table from example pulled out of sample code on docs website

See original GitHub issue

Desktop (please complete the following information):

Mac OS 11.6.4

Describe the bug

Straight from website sample failing to construct table

Traceback (most recent call last):
  File "/Users/test.py", line 20, in <module>
    dt = Tableview(
  File "/Users/venv/lib/python3.9/site-packages/ttkbootstrap/tableview.py", line 544, in __init__
    self._build_tableview_widget(coldata, rowdata, bootstyle)
  File "/Users/venv/lib/python3.9/site-packages/ttkbootstrap/tableview.py", line 2081, in _build_tableview_widget
    self.hbar = ttk.Scrollbar(
  File "/Users/venv/lib/python3.9/site-packages/ttkbootstrap/style.py", line 4872, in __init__
    self.configure(style=ttkstyle)
  File "/Users/venv/lib/python3.9/site-packages/ttkbootstrap/style.py", line 4911, in configure
    func(self, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-style"

To Reproduce

From sample in the website, plucked straight out- nothing changed

import ttkbootstrap as ttk
from ttkbootstrap.tableview import Tableview
from ttkbootstrap.constants import *

app = ttk.Window()
colors = app.style.colors

coldata = [
    {"text": "LicenseNumber", "stretch": False},
    "CompanyName",
    {"text": "UserCount", "stretch": False},
]

rowdata = [
    ('A123', 'IzzyCo', 12),
    ('A136', 'Kimdee Inc.', 45),
    ('A158', 'Farmadding Co.', 36)
]

dt = Tableview(
    master=app,
    coldata=coldata,
    rowdata=rowdata,
    paginated=True,
    searchable=True,
    bootstyle=PRIMARY,
    stripecolor=(colors.light, None),
)
dt.pack(fill=BOTH, expand=YES, padx=10, pady=10)

app.mainloop()

from https://ttkbootstrap.readthedocs.io/en/latest/api/tableview/tableview/#ttkbootstrap.tableview.Tableview

Expected behavior

Table is created

Screenshots

No response

Additional context

https://ttkbootstrap.readthedocs.io/en/latest/api/tableview/tableview/#ttkbootstrap.tableview.Tableview

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
israel-dryercommented, Mar 26, 2022

I wasn’t able to replicate this issue. I’m running Python 3.9.7 with TCL 8.6.11. I can’t see why the TCL version you are using would cause this issue, but that is really the only difference I can see. I think the Python that ships with Mac is 8.6.8, while the Mac installer from python.org ships with 8.6.11.

image
0reactions
matt-falknercommented, Mar 28, 2022

NOTE: This bug still exists for TCL version 8.6.8 + Python 3.9.X

Solution: However, I fixed it for myself by installing python 3.10.4 https://www.python.org/downloads/release/python-3104/ which comes packaged with TCL version 8.6.12

image
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Google Docs, Sheets, Slides & Forms error ...
If you get an error message such as "Something went wrong. Reload" or "Unable to load file" preventing you from making edits on...
Read more >
Create and use tables | BigQuery - Google Cloud
This document describes how to create and use standard (built-in) tables in BigQuery. For information about creating other table types, see:.
Read more >
PySimpleGUI
It does the layout, boilerplate code, creates and manages the GUI Widgets for you and presents you with a simple, efficient interface. Most...
Read more >
CREATE TABLE - Snowflake Documentation
CREATE TABLE ¶. Creates a new table in the current/specified schema or replaces an existing table. A table can have multiple columns, with...
Read more >
Working with tables | Google Docs
Insert and delete rows, columns, or entire tables. Insert content into table cells. Read content from table cells. Modify column properties and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found