Skip to content
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: 'Style' object has no attribute 'clear_meta_and_links' #389

Closed
matiasandina opened this issue May 9, 2024 · 15 comments
Closed
Labels
bug Something isn't working

Comments

@matiasandina
Copy link

matiasandina commented May 9, 2024

Describe the bug
Cannot create a local project
Cannot go into the settings

To Reproduce
First fresh install using conda-forge in conda env.

  • Creating a local project gets to this error.
  • Clicking the settings button gets to this error
  • Clicking help gets to this error

Log file

(datashuttle-env) matias@choilab:~$ datashuttle launch
╭──────────────────── Traceback (most recent call last) ────────────────────╮
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/widget.py:3281 in render_lines                                   │
│                                                                           │
│   3278 │   │   Returns:                                                   │
│   3279 │   │   │   A list of list of segments.                            │
│   3280 │   │   """                                                        │
│ ❱ 3281 │   │   strips = self._styles_cache.render_widget(self, crop)      │
│   3282 │   │   return strips                                              │
│   3283 │                                                                  │
│   3284 │   def get_style_at(self, x: int, y: int) -> Style:               │
│                                                                           │
│ ╭─────────────────── locals ───────────────────╮                          │
│ │ crop = Region(x=0, y=0, width=77, height=39) │                          │
│ │ self = SettingsScreen()                      │                          │
│ ╰──────────────────────────────────────────────╯                          │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/_styles_cache.py:119 in render_widget                            │
│                                                                           │
│   116 │   │                                                               │
│   117 │   │   base_background, background = widget._opacity_background_co │
│   118 │   │   styles = widget.styles                                      │
│ ❱ 119 │   │   strips = self.render(                                       │
│   120 │   │   │   styles,                                                 │
│   121 │   │   │   widget.region.size,                                     │
│   122 │   │   │   base_background,                                        │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │      background = Color(18, 18, 18)                                   │ │
│ │ base_background = Color(18, 18, 18)                                   │ │
│ │ border_subtitle = None                                                │ │
│ │    border_title = None                                                │ │
│ │            crop = Region(x=0, y=0, width=77, height=39)               │ │
│ │            self = <textual._styles_cache.StylesCache object at        │ │
│ │                   0x7b7656431840>                                     │ │
│ │          styles = RenderStyles(                                       │ │
│ │                   │   layout=<vertical>,                              │ │
│ │                   │   background=Color(18, 18, 18, a=0.6),            │ │
│ │                   │   overflow_y='auto',                              │ │
│ │                   │   scrollbar_color=Color(35, 86, 139),             │ │
│ │                   │   scrollbar_color_hover=Color(35, 86, 139),       │ │
│ │                   │   scrollbar_color_active=Color(231, 146, 13),     │ │
│ │                   │   scrollbar_corner_color=Color(20, 25, 31),       │ │
│ │                   │   scrollbar_background=Color(20, 25, 31),         │ │
│ │                   │   scrollbar_background_hover=Color(0, 5, 15),     │ │
│ │                   │   scrollbar_background_active=Color(0, 0, 0),     │ │
│ │                   │   scrollbar_size_vertical=2,                      │ │
│ │                   │   scrollbar_size_horizontal=1,                    │ │
│ │                   │   align_horizontal='center',                      │ │
│ │                   │   align_vertical='middle',                        │ │
│ │                   │   link_color=Color(255, 255, 255, a=0.87),        │ │
│ │                   │   auto_link_color=True,                           │ │
│ │                   │   link_background=Color(0, 0, 0, a=0),            │ │
│ │                   │   link_style=Style(underline=True),               │ │
│ │                   │   link_color_hover=Color(255, 255, 255, a=0.87),  │ │
│ │                   │   auto_link_color_hover=True,                     │ │
│ │                   │   link_background_hover=Color(1, 120, 212),       │ │
│ │                   │   link_style_hover=Style(                         │ │
│ │                   │   │   bold=True,                                  │ │
│ │                   │   │   underline=False                             │ │
│ │                   │   )                                               │ │
│ │                   )                                                   │ │
│ │          widget = SettingsScreen()                                    │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/_styles_cache.py:218 in render                                   │
│                                                                           │
│   215 │   │   render_line = self.render_line                              │
│   216 │   │   for y in crop.line_range:                                   │
│   217 │   │   │   if is_dirty(y) or y not in self._cache:                 │
│ ❱ 218 │   │   │   │   strip = render_line(                                │
│   219 │   │   │   │   │   styles,                                         │
│   220 │   │   │   │   │   y,                                              │
│   221 │   │   │   │   │   size,                                           │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │             _height = 39                                              │ │
│ │           add_strip = <built-in method append of list object at       │ │
│ │                       0x7b7656471700>                                 │ │
│ │          background = Color(18, 18, 18)                               │ │
│ │     base_background = Color(18, 18, 18)                               │ │
│ │     border_subtitle = None                                            │ │
│ │        border_title = None                                            │ │
│ │             console = <console width=77 ColorSystem.TRUECOLOR>        │ │
│ │        content_size = Size(width=77, height=39)                       │ │
│ │                crop = Region(x=0, y=0, width=77, height=39)           │ │
│ │             filters = [                                               │ │
│ │                       │   <textual.filter.ANSIToTruecolor object at   │ │
│ │                       0x7b7657803250>                                 │ │
│ │                       ]                                               │ │
│ │            is_dirty = <built-in method __contains__ of set object at  │ │
│ │                       0x7b7656553840>                                 │ │
│ │             opacity = 1.0                                             │ │
│ │             padding = Spacing(top=0, right=0, bottom=0, left=0)       │ │
│ │ render_content_line = <bound method Widget.render_line of             │ │
│ │                       SettingsScreen()>                               │ │
│ │         render_line = <bound method StylesCache.render_line of        │ │
│ │                       <textual._styles_cache.StylesCache object at    │ │
│ │                       0x7b7656431840>>                                │ │
│ │                self = <textual._styles_cache.StylesCache object at    │ │
│ │                       0x7b7656431840>                                 │ │
│ │                size = Size(width=77, height=39)                       │ │
│ │              strips = []                                              │ │
│ │              styles = RenderStyles(                                   │ │
│ │                       │   layout=<vertical>,                          │ │
│ │                       │   background=Color(18, 18, 18, a=0.6),        │ │
│ │                       │   overflow_y='auto',                          │ │
│ │                       │   scrollbar_color=Color(35, 86, 139),         │ │
│ │                       │   scrollbar_color_hover=Color(35, 86, 139),   │ │
│ │                       │   scrollbar_color_active=Color(               │ │
│ │                       │   │   231,                                    │ │
│ │                       │   │   146,                                    │ │
│ │                       │   │   13                                      │ │
│ │                       │   ),                                          │ │
│ │                       │   scrollbar_corner_color=Color(20, 25, 31),   │ │
│ │                       │   scrollbar_background=Color(20, 25, 31),     │ │
│ │                       │   scrollbar_background_hover=Color(           │ │
│ │                       │   │   0,                                      │ │
│ │                       │   │   5,                                      │ │
│ │                       │   │   15                                      │ │
│ │                       │   ),                                          │ │
│ │                       │   scrollbar_background_active=Color(          │ │
│ │                       │   │   0,                                      │ │
│ │                       │   │   0,                                      │ │
│ │                       │   │   0                                       │ │
│ │                       │   ),                                          │ │
│ │                       │   scrollbar_size_vertical=2,                  │ │
│ │                       │   scrollbar_size_horizontal=1,                │ │
│ │                       │   align_horizontal='center',                  │ │
│ │                       │   align_vertical='middle',                    │ │
│ │                       │   link_color=Color(255, 255, 255, a=0.87),    │ │
│ │                       │   auto_link_color=True,                       │ │
│ │                       │   link_background=Color(0, 0, 0, a=0),        │ │
│ │                       │   link_style=Style(underline=True),           │ │
│ │                       │   link_color_hover=Color(                     │ │
│ │                       │   │   255,                                    │ │
│ │                       │   │   255,                                    │ │
│ │                       │   │   255,                                    │ │
│ │                       │   │   a=0.87                                  │ │
│ │                       │   ),                                          │ │
│ │                       │   auto_link_color_hover=True,                 │ │
│ │                       │   link_background_hover=Color(1, 120, 212),   │ │
│ │                       │   link_style_hover=Style(                     │ │
│ │                       │   │   bold=True,                              │ │
│ │                       │   │   underline=False                         │ │
│ │                       │   )                                           │ │
│ │                       )                                               │ │
│ │               width = 77                                              │ │
│ │                   y = 0                                               │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/_styles_cache.py:428 in render_line                              │
│                                                                           │
│   425 │   │   │   # Content with border and padding (C)                   │
│   426 │   │   │   content_y = y - gutter.top                              │
│   427 │   │   │   if content_y < content_height:                          │
│ ❱ 428 │   │   │   │   line = render_content_line(y - gutter.top)          │
│   429 │   │   │   │   line = line.adjust_cell_length(content_width)       │
│   430 │   │   │   else:                                                   │
│   431 │   │   │   │   line = [make_blank(content_width, inner)]           │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │           background = Color(18, 18, 18)                              │ │
│ │      base_background = Color(18, 18, 18)                              │ │
│ │        border_bottom = ''                                             │ │
│ │  border_bottom_color = Color(0, 255, 0)                               │ │
│ │          border_left = ''                                             │ │
│ │    border_left_color = Color(0, 255, 0)                               │ │
│ │         border_right = ''                                             │ │
│ │   border_right_color = Color(0, 255, 0)                               │ │
│ │      border_subtitle = None                                           │ │
│ │         border_title = None                                           │ │
│ │           border_top = ''                                             │ │
│ │     border_top_color = Color(0, 255, 0)                               │ │
│ │              console = <console width=77 ColorSystem.TRUECOLOR>       │ │
│ │       content_height = 39                                             │ │
│ │         content_size = Size(width=77, height=39)                      │ │
│ │        content_width = 77                                             │ │
│ │            content_y = 0                                              │ │
│ │           from_color = <bound method Style.from_color of <class       │ │
│ │                        'rich.style.Style'>>                           │ │
│ │               gutter = Spacing(top=0, right=0, bottom=0, left=0)      │ │
│ │               height = 39                                             │ │
│ │                inner = Style(                                         │ │
│ │                        │   bgcolor=Color(                             │ │
│ │                        │   │   '#121212',                             │ │
│ │                        │   │   ColorType.TRUECOLOR,                   │ │
│ │                        │   │   triplet=ColorTriplet(                  │ │
│ │                        │   │   │   red=18,                            │ │
│ │                        │   │   │   green=18,                          │ │
│ │                        │   │   │   blue=18                            │ │
│ │                        │   │   )                                      │ │
│ │                        │   )                                          │ │
│ │                        )                                              │ │
│ │              opacity = 1.0                                            │ │
│ │                outer = Style(                                         │ │
│ │                        │   bgcolor=Color(                             │ │
│ │                        │   │   '#121212',                             │ │
│ │                        │   │   ColorType.TRUECOLOR,                   │ │
│ │                        │   │   triplet=ColorTriplet(                  │ │
│ │                        │   │   │   red=18,                            │ │
│ │                        │   │   │   green=18,                          │ │
│ │                        │   │   │   blue=18                            │ │
│ │                        │   │   )                                      │ │
│ │                        │   )                                          │ │
│ │                        )                                              │ │
│ │       outline_bottom = ''                                             │ │
│ │ outline_bottom_color = Color(0, 255, 0)                               │ │
│ │         outline_left = ''                                             │ │
│ │   outline_left_color = Color(0, 255, 0)                               │ │
│ │        outline_right = ''                                             │ │
│ │  outline_right_color = Color(0, 255, 0)                               │ │
│ │          outline_top = ''                                             │ │
│ │    outline_top_color = Color(0, 255, 0)                               │ │
│ │           pad_bottom = 0                                              │ │
│ │             pad_left = 0                                              │ │
│ │            pad_right = 0                                              │ │
│ │              pad_top = 0                                              │ │
│ │              padding = Spacing(top=0, right=0, bottom=0, left=0)      │ │
│ │                 post = <function                                      │ │
│ │                        StylesCache.render_line.<locals>.post at       │ │
│ │                        0x7b7657675c60>                                │ │
│ │  render_content_line = <bound method Widget.render_line of            │ │
│ │                        SettingsScreen()>                              │ │
│ │                 self = <textual._styles_cache.StylesCache object at   │ │
│ │                        0x7b7656431840>                                │ │
│ │                 size = Size(width=77, height=39)                      │ │
│ │               styles = RenderStyles(                                  │ │
│ │                        │   layout=<vertical>,                         │ │
│ │                        │   background=Color(18, 18, 18, a=0.6),       │ │
│ │                        │   overflow_y='auto',                         │ │
│ │                        │   scrollbar_color=Color(35, 86, 139),        │ │
│ │                        │   scrollbar_color_hover=Color(35, 86, 139),  │ │
│ │                        │   scrollbar_color_active=Color(              │ │
│ │                        │   │   231,                                   │ │
│ │                        │   │   146,                                   │ │
│ │                        │   │   13                                     │ │
│ │                        │   ),                                         │ │
│ │                        │   scrollbar_corner_color=Color(20, 25, 31),  │ │
│ │                        │   scrollbar_background=Color(20, 25, 31),    │ │
│ │                        │   scrollbar_background_hover=Color(          │ │
│ │                        │   │   0,                                     │ │
│ │                        │   │   5,                                     │ │
│ │                        │   │   15                                     │ │
│ │                        │   ),                                         │ │
│ │                        │   scrollbar_background_active=Color(         │ │
│ │                        │   │   0,                                     │ │
│ │                        │   │   0,                                     │ │
│ │                        │   │   0                                      │ │
│ │                        │   ),                                         │ │
│ │                        │   scrollbar_size_vertical=2,                 │ │
│ │                        │   scrollbar_size_horizontal=1,               │ │
│ │                        │   align_horizontal='center',                 │ │
│ │                        │   align_vertical='middle',                   │ │
│ │                        │   link_color=Color(255, 255, 255, a=0.87),   │ │
│ │                        │   auto_link_color=True,                      │ │
│ │                        │   link_background=Color(0, 0, 0, a=0),       │ │
│ │                        │   link_style=Style(underline=True),          │ │
│ │                        │   link_color_hover=Color(                    │ │
│ │                        │   │   255,                                   │ │
│ │                        │   │   255,                                   │ │
│ │                        │   │   255,                                   │ │
│ │                        │   │   a=0.87                                 │ │
│ │                        │   ),                                         │ │
│ │                        │   auto_link_color_hover=True,                │ │
│ │                        │   link_background_hover=Color(1, 120, 212),  │ │
│ │                        │   link_style_hover=Style(                    │ │
│ │                        │   │   bold=True,                             │ │
│ │                        │   │   underline=False                        │ │
│ │                        │   )                                          │ │
│ │                        )                                              │ │
│ │                width = 77                                             │ │
│ │                    y = 0                                              │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/widget.py:3265 in render_line                                    │
│                                                                           │
│   3262 │   │   │   A rendered line.                                       │
│   3263 │   │   """                                                        │
│   3264 │   │   if self._dirty_regions:                                    │
│ ❱ 3265 │   │   │   self._render_content()                                 │
│   3266 │   │   try:                                                       │
│   3267 │   │   │   line = self._render_cache.lines[y]                     │
│   3268 │   │   except IndexError:                                         │
│                                                                           │
│ ╭──────── locals ─────────╮                                               │
│ │ self = SettingsScreen() │                                               │
│ │    y = 0                │                                               │
│ ╰─────────────────────────╯                                               │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/widget.py:3230 in _render_content                                │
│                                                                           │
│   3227 │   │   )                                                          │
│   3228 │   │                                                              │
│   3229 │   │   segments = self._console.render(renderable, options)       │
│ ❱ 3230 │   │   lines = list(                                              │
│   3231 │   │   │   islice(                                                │
│   3232 │   │   │   │   Segment.split_and_crop_lines(                      │
│   3233 │   │   │   │   │   segments, width, include_new_lines=False, pad= │
│                                                                           │
│ ╭───────────────────────────── locals ─────────────────────────────╮      │
│ │     height = 39                                                  │      │
│ │    options = ConsoleOptions(                                     │      │
│ │              │   size=ConsoleDimensions(width=77, height=39),    │      │
│ │              │   legacy_windows=False,                           │      │
│ │              │   min_width=77,                                   │      │
│ │              │   max_width=77,                                   │      │
│ │              │   is_terminal=True,                               │      │
│ │              │   encoding='utf-8',                               │      │
│ │              │   max_height=39,                                  │      │
│ │              │   justify=None,                                   │      │
│ │              │   overflow=None,                                  │      │
│ │              │   no_wrap=False,                                  │      │
│ │              │   highlight=False,                                │      │
│ │              │   markup=None,                                    │      │
│ │              │   height=39                                       │      │
│ │              )                                                   │      │
│ │ renderable = <textual.widget._Styled object at 0x7b7656487be0>   │      │
│ │   segments = <generator object Console.render at 0x7b7656439690> │      │
│ │       self = SettingsScreen()                                    │      │
│ │      width = 77                                                  │      │
│ ╰──────────────────────────────────────────────────────────────────╯      │
│                                                                           │
│ /home/matias/.local/lib/python3.10/site-packages/rich/segment.py:292 in   │
│ split_and_crop_lines                                                      │
│                                                                           │
│ /home/matias/.local/lib/python3.10/site-packages/rich/console.py:1330 in  │
│ render                                                                    │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/widget.py:171 in <genexpr>                                       │
│                                                                           │
│    168 │   │   │   )                                                      │
│    169 │   │   link_style = self.link_style                               │
│    170 │   │   if link_style:                                             │
│ ❱  171 │   │   │   result_segments = (                                    │
│    172 │   │   │   │   _Segment(                                          │
│    173 │   │   │   │   │   text,                                          │
│    174 │   │   │   │   │   (                                              │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │         .0 = <generator object                                        │ │
│ │              _Styled.__rich_console__.<locals>.<genexpr> at           │ │
│ │              0x7b76564c8580>                                          │ │
│ │   _Segment = <class 'rich.segment.Segment'>                           │ │
│ │ link_style = Style(                                                   │ │
│ │              │   color=Color(                                         │ │
│ │              │   │   '#e0e0e0',                                       │ │
│ │              │   │   ColorType.TRUECOLOR,                             │ │
│ │              │   │   triplet=ColorTriplet(                            │ │
│ │              │   │   │   red=224,                                     │ │
│ │              │   │   │   green=224,                                   │ │
│ │              │   │   │   blue=224                                     │ │
│ │              │   │   )                                                │ │
│ │              │   ),                                                   │ │
│ │              │   bgcolor=Color(                                       │ │
│ │              │   │   '#121212',                                       │ │
│ │              │   │   ColorType.TRUECOLOR,                             │ │
│ │              │   │   triplet=ColorTriplet(                            │ │
│ │              │   │   │   red=18,                                      │ │
│ │              │   │   │   green=18,                                    │ │
│ │              │   │   │   blue=18                                      │ │
│ │              │   │   )                                                │ │
│ │              │   ),                                                   │ │
│ │              │   underline=True                                       │ │
│ │              )                                                        │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/widget.py:165 in <genexpr>                                       │
│                                                                           │
│    162 │   │   _Segment = Segment                                         │
│    163 │   │   if style:                                                  │
│    164 │   │   │   apply = style.__add__                                  │
│ ❱  165 │   │   │   result_segments = (                                    │
│    166 │   │   │   │   _Segment(text, apply(_style), None)                │
│    167 │   │   │   │   for text, _style, control in result_segments       │
│    168 │   │   │   )                                                      │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │       .0 = <generator object Console.render at 0x7b76564c8510>        │ │
│ │ _Segment = <class 'rich.segment.Segment'>                             │ │
│ │    apply = <bound method Style.__add__ of                             │ │
│ │            Style(color=Color('#e0e0e0', ColorType.TRUECOLOR,          │ │
│ │            triplet=ColorTriplet(red=224, green=224, blue=224)),       │ │
│ │            bgcolor=Color('#121212', ColorType.TRUECOLOR,              │ │
│ │            triplet=ColorTriplet(red=18, green=18, blue=18)))>         │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
│                                                                           │
│ /home/matias/.local/lib/python3.10/site-packages/rich/console.py:1330 in  │
│ render                                                                    │
│                                                                           │
│ /home/matias/miniconda3/envs/datashuttle-env/lib/python3.10/site-packages │
│ /textual/renderables/background_screen.py:58 in process_segments          │
│                                                                           │
│   55 │   │   │   if control:                                              │
│   56 │   │   │   │   yield segment                                        │
│   57 │   │   │   else:                                                    │
│ ❱ 58 │   │   │   │   style = NULL_STYLE if style is None else style.clear │
│   59 │   │   │   │   yield _Segment(                                      │
│   60 │   │   │   │   │   text,                                            │
│   61 │   │   │   │   │   (                                                │
│                                                                           │
│ ╭─────────────────────────────── locals ────────────────────────────────╮ │
│ │         _Segment = <class 'rich.segment.Segment'>                     │ │
│ │              cls = <class                                             │ │
│ │                    'textual.renderables.background_screen.Background… │ │
│ │            color = Color(18, 18, 18, a=0.6)                           │ │
│ │          control = None                                               │ │
│ │  from_rich_color = <bound method Color.from_rich_color of <class      │ │
│ │                    'textual.color.Color'>>                            │ │
│ │       NULL_STYLE = Style()                                            │ │
│ │          segment = Segment(                                           │ │
│ │                    │   '                                              │ │
│ │                    ',                                                 │ │
│ │                    │   Style(                                         │ │
│ │                    │   │   bgcolor=Color(                             │ │
│ │                    │   │   │   '#1e1e1e',                             │ │
│ │                    │   │   │   ColorType.TRUECOLOR,                   │ │
│ │                    │   │   │   triplet=ColorTriplet(                  │ │
│ │                    │   │   │   │   red=30,                            │ │
│ │                    │   │   │   │   green=30,                          │ │
│ │                    │   │   │   │   blue=30                            │ │
│ │                    │   │   │   )                                      │ │
│ │                    │   │   )                                          │ │
│ │                    │   )                                              │ │
│ │                    )                                                  │ │
│ │         segments = <generator object Console.render at                │ │
│ │                    0x7b76564c8660>                                    │ │
│ │            style = Style(                                             │ │
│ │                    │   bgcolor=Color(                                 │ │
│ │                    │   │   '#1e1e1e',                                 │ │
│ │                    │   │   ColorType.TRUECOLOR,                       │ │
│ │                    │   │   triplet=ColorTriplet(                      │ │
│ │                    │   │   │   red=30,                                │ │
│ │                    │   │   │   green=30,                              │ │
│ │                    │   │   │   blue=30                                │ │
│ │                    │   │   )                                          │ │
│ │                    │   )                                              │ │
│ │                    )                                                  │ │
│ │ style_from_color = <bound method Style.from_color of <class           │ │
│ │                    'rich.style.Style'>>                               │ │
│ │             text = '                                                  │ │
│ │                    '                                                  │ │
│ ╰───────────────────────────────────────────────────────────────────────╯ │
╰───────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Style' object has no attribute 'clear_meta_and_links'
(datashuttle-env) matias@choilab:~$ 

Computer used (please complete the following information):

  • OS: Ubuntu 22.04 64-bit / Linux 6.5.0.25-generic
  • Hardware specs128 Gb RAM, intel i912900
@matiasandina matiasandina added the bug Something isn't working label May 9, 2024
@adamltyson
Copy link
Member

Thanks for raising the issue @matiasandina. Some of the team are away currently, so we may take a while to get back to you.

I can't reproduce on my (Ubuntu 20.04) machine with:

conda create --name datashuttle-test -c conda-forge datashuttle -y
conda activate datashuttle-test
datashuttle launch

Can anyone else @neuroinformatics-unit/neuroinformatics-all?

@alessandrofelder
Copy link
Member

I cannot on my macbook, can try on Ubuntu 22 when I am back next week 🤔

@IgorTatarnikov
Copy link
Member

I'm able to launch it successfully on Ubuntu 22.04 / Linux 6.5.0.28-generic in a fresh python 3.10 environment.

@lochhh
Copy link
Contributor

lochhh commented May 9, 2024

Hi, looks like it could be a rich version issue

@matiasandina
Copy link
Author

matiasandina commented May 9, 2024

Thanks for the quick checks. Interestingly, this environment works well! 🤔

conda create --name datashuttle-test -c conda-forge datashuttle -y
conda activate datashuttle-test
datashuttle launch

I created the first one as suggested in the docs

conda create -n datashuttle-env python=3.10
conda activate datashuttle-env
conda install -c conda-forge datashuttle

Maybe there are some differences in the environment creation ?

rich is the same in both envs

(datashuttle-test) matias@choilab:~$ conda list rich
# packages in environment at /home/matias/miniconda3/envs/datashuttle-test:
#
# Name                    Version                   Build  Channel
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
(datashuttle-test) matias@choilab:~$ conda deactivate
matias@choilab:~$ conda activate datashuttle-env
(datashuttle-env) matias@choilab:~$ conda list rich
# packages in environment at /home/matias/miniconda3/envs/datashuttle-env:
#
# Name                    Version                   Build  Channel
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
```

@adamltyson
Copy link
Member

The only difference I can think of is that "my" way, would fetch a different version of Python itself (and from conda-forge).

@lochhh
Copy link
Contributor

lochhh commented May 9, 2024

Strange 🤔 Followed the docs setup steps on Ubuntu 22.04.4 LTS (WSL2 ) and it launches fine.

@matiasandina
Copy link
Author

matiasandina commented May 9, 2024 via email

@adamltyson
Copy link
Member

Weird, this shouldn't make a difference. Anyway, glad you're up and running @matiasandina, let us know if you have any more problems.

I'll keep this issue open so we can dig into this later.

@JoeZiminski
Copy link
Member

JoeZiminski commented May 14, 2024

Hey @matiasandina thanks for this report!!

This is very interesting case, it seems at runtime the version of rich being used is located at:

/home/matias/.local/lib/python3.10/site-packages/rich/console.py:1330 in  │
│ render

rather than the correction version at:

# packages in environment at /home/matias/miniconda3/envs/datashuttle-test:
#
# Name                    Version                   Build  Channel
rich                      13.7.1             pyhd8ed1ab_0    conda-forge

I have no idea why this is happening, though it is a strange thing I've very seen infrequently before with conda when using it on a HPC. I guess the command to install the specific version 3.10 is somehow conflicting with an already existing 3.10 installation? Of course conda should keep these isolated but it may be failing in this case for whatever reason. It seems similar to this report (no answer) and this one that indicates it may be a conflict between conda and pip. Anyways, I think this can be filed under 'conda weirdness' and glad it is working now!

In any case, there is no reason why the docs should specify the install is with python=3.10, in particular if it is causing issues like this.

This can be changed to

conda create -n datashuttle-env
conda activate datashuttle-env
conda install -c conda-forge datashuttle

if people agree.

(The reason the multi-line install rather than one-liner is used in the docs is just to make each step clearer to new conda users)

@JoeZiminski
Copy link
Member

JoeZiminski commented May 16, 2024

Coincidentally I had the same problem on another project and it led to discovering some very crazy conda/pip behaviour I did not know about that I think led to this error.

You may have multiple pip installed on your system (which -a pip) and one of these will be used by default when you do a pip command e.g. pip install datashuttle. If you create a conda environment but that environment does not install pip with conda install pip, when you pip install anything when in the conda environment it will use the default pip and install it outside of the environment.

To get it to work properly, you need to conda install pip then deactivate and reactivate the environment. When you reactivate the environment conda will now use the conda-installed pip as default. However it is not always enough.

In some circumstances (I'm not exactly sure which), even if pip is installed by conda during environment setup, the conda env may or may not use the conda installed pip. For example, I am trying it on our cluster after module load miniconda and if I do conda create -n myenv -c conda-forge python==3.8 datashuttle. Pip is installed in the conda env, but nonetheless pip at /nfs/nhome/live/jziminski/.local/lib/python3.8/site-packages is used (pip show pip).* In this case, maybe something similar is happening, Rich is installed by conda in the conda env, but for some reason the systems pip version is used at runtime.

On our HPC, if I request python==3.12 then pip is installed in the conda env and things work okay. pip show pip gives /nfs/nhome/live/jziminski/.conda/envs/myenv/lib/python3.12/site-packages.

So, fundamentally it seems that if you request a python version when installing a conda env and you have a system version of python with pip, conda will not necessarily use the correct version of pip (and possibly any other pip-installed dependency). I guess this problem is in theory is also possible doing conda create -n myenv without specifying a version, but it is much less likely the most recent version of python will be installed on a users system.

I am very surprised by this behaviour, it may be worth a blog post on the 'How to' page. Although I not sure how to reliably deal with it 😅.

* This is also true with python -m pip show pip and even conda run pip show pip or conda run python -m pip show pip.

@adamltyson
Copy link
Member

This is very weird. I've had various issues with conda on our HPC, but I've never come across this locally, and I've made about 1-5 conda envs every week for the last 6 years!

@JoeZiminski
Copy link
Member

JoeZiminski commented May 17, 2024

I wonder if this is a clue in itself, do you have any non-conda managed installs of Python on your machine (or maybe, only an old one)? If not, I think you should never see this problem!

@adamltyson
Copy link
Member

On some machines I have the system Python, but I've only ever used conda, so it's unlikely I ever have a non-conda version of the Python version I'm trying to use.

@JoeZiminski
Copy link
Member

This has been adressed in #386 and properly tested in #394. Thanks @matiasandina please don't hestitate to raise issues / get in contact with any other problems or feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants