-
Notifications
You must be signed in to change notification settings - Fork 63
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
AttributeError: can't set attribute #224
Comments
Same error when building the Debian package and running tests:
|
I'm also encountering this same problem on my Fedora machine when calling |
Same Here in my machine (Arch) I found the issue that solves the installation errors caused due to
|
I'm also encountering the same problem on my MacBook Pro M1 when running Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/__main__.py", line 169, in main
pres.run()
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/pres.py", line 159, in run
self.tui = lookatme.tui.create_tui(self, start_slide=start_slide)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 435, in create_tui
tui = MarkdownTui(pres, start_slide)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 242, in __init__
self.prep_pres(self.pres, start_idx)
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 255, in prep_pres
self.update()
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 370, in update
self.update_body()
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 339, in update_body
rendered = self.slide_renderer.render_slide(self.curr_slide)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 77, in render_slide
raise res
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 101, in run
res = self.do_render(to_render, slide_num)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 153, in do_render
self._render_tokens(tokens)
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/tui.py", line 196, in _render_tokens
res = render_token(token, stack[-1], stack, self.loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/contrib/__init__.py", line 120, in inner
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/render/markdown_block.py", line 493, in render_paragraph
res = render_text(token, body, stack, loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/contrib/__init__.py", line 120, in inner
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/render/markdown_block.py", line 448, in render_text
res = inline_lexer.output(text)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/mistune.py", line 585, in output
ret = manipulate(text)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/mistune.py", line 579, in manipulate
out = getattr(self, 'output_%s' % key)(m)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/mistune.py", line 680, in output_code
return self.renderer.codespan(text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/render/markdown_inline.py", line 24, in inner
return fn(text, styles)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/contrib/__init__.py", line 120, in inner
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/render/markdown_inline.py", line 238, in codespan
res = pygments_render.render_text(" " + text + " ", plain=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/render/pygments.py", line 72, in render_text
x[0].background = style_bg
^^^^^^^^^^^^^^^
AttributeError: property 'background' of 'AttrSpec' object has no setter
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/bin/lookatme", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/__main__.py", line 171, in main
number = pres.get_tui().curr_slide.number + 1
^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lookatme/pres.py", line 164, in get_tui
raise ValueError(
ValueError: Tui has not been set, has the presentation been run yet? Tried the simple presentation with a simple code block too with the following command Error rendering slide 3: property 'background' of 'AttrSpec' object has no setter
See /var/folders/sk/7ym9q08j4lxc75gtyl0yyqjc0000gn/T/lookatme.log for traceback
Aborted! (The full log file is here) |
In case it helps... I found a similar issue and I ended up uninstalling the packages ( |
This might not help anyone, but I found I could "fix" this issue locally by, x[0].background = style_bg And change it t: x[0]._AttrSpec__set_background(style_bg) I'm not 100% sure this is how you're supposed to modify the background, but at least it gets around the error...? |
I ended up installing newer |
I unfortunately don’t like the styling of the new version as much, I could also probably figure out how to style it the same but it's definitely different ahah |
Not sure how late am I to this but I have found a fix to this. I couldn't use @avegancafe solution of changing to My solution: go to line 798 has a property called I added the following: @background.setter
def background(self, background: str):
self.__set_background(background) and it worked. Not sure if this can be resolved by getting a latest update to urwid |
Describe the bug
Unable to use any markdown file with fenced code blocks, like the terminal_ext example
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Render the slides
Screenshots
Environment (please complete the following information):
lookatme --version
]: lookatme, version 2.5.5Additional context
Pygments==2.17.2
The text was updated successfully, but these errors were encountered: