johentsch / ms3

A parser for annotated MuseScore 3 files.
https://ms3.readthedocs.io
GNU General Public License v3.0
40 stars 3 forks source link

module 'webcolors' has no attribute 'CSS3_NAMES_TO_HEX' #115

Open kevinlinxc opened 2 weeks ago

kevinlinxc commented 2 weeks ago

When I try to import ms3, I get this error:

    411 MS3_COLORS = list(MS3_HTML.values())
    412 CSS2MS3 = {c[4:]: c for c in MS3_COLORS}
--> 413 CSS_COLORS = list(webcolors.CSS3_NAMES_TO_HEX.keys())
    414 COLORS = sum([[c, CSS2MS3[c]] if c in CSS2MS3 else [c] for c in CSS_COLORS], [])
    415 rgba = namedtuple("RGBA", ["r", "g", "b", "a"])

AttributeError: module 'webcolors' has no attribute 'CSS3_NAMES_TO_HEX'

ms3 version 2.5.1 webcolors version 24.6.0

kevinlinxc commented 2 weeks ago

I changed the line to CSS_COLORS = list(webcolors._definitions._CSS3_NAMES_TO_HEX.keys())

and it works now but maybe downgrading or pinning a version would be easier

johentsch commented 2 weeks ago

Thanks for reporting the fix, @kevinlinxc. I will fix this eventually.