alexgorji / musicscore

14 stars 5 forks source link

Error during first use of library after installing with pip on python3.10 #1

Closed lhpt2 closed 1 year ago

lhpt2 commented 2 years ago

When I first tried to use this library after I installed it with pip I got the following error:

File "/lib/python3.10/site-packages/musicxml/xmlelement/xmlchildcontainer.py", line 399, in add_element
    self.reset_frozen()
AttributeError: 'XMLChildContainer' object has no attribute 'reset_frozen'

I worked around it by commenting out line 399 in the specified python script. It would be cool to fix this issue though, so there's no need to comment out the line every time after a fresh install of the library.

cy-polo commented 2 years ago

Hello, I have the same issue.

Can you please @alexgorji check? This lib looks so usefull but I can't use it.

fornof commented 1 year ago

I have the same issue. I found this solves my issue:


    def reset_frozen(self):
        if self.up:
            self.up.reset_frozen()
        self._traversed = None
        self._iterated_leaves = None
        self._reversed_path_to_root = None

Write to here: python3.9/site-packages/musicxml/xmlelement/xmlchildcontainer.py Found here: https://github.com/alexgorji/musicxml/blob/41ea3d7da7468c2f8c6e86423f99b76007c3c42c/tree/tree.py

SirNate0 commented 1 year ago

That fix worked for me with Python 3.9.

bolau commented 1 year ago

Same here with Python 3.10.

Erriez commented 1 year ago

I have the same error with Python 3.10.

alexgorji commented 1 year ago

Hi guys/gals! First of all I'm sorry that it took me soooo long to get back to you and thanks for spotting (and solving) the bug. The latest version of musicscore2 should work now without missing the reset_frozen method. The problem was occured during packagin for PyPi and my tests didn't catch it. I now created an extra repository for testing after installing the library via pip: https://github.com/alexgorji/musicscore2-tests to avoid these kind of problems in the future. All tests are passing at the moment for ptyhon versions 3.9, 3.10 and 3.11 (see Actions) Cheers Alex