twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
361 stars 74 forks source link

ImportError in Python 3.10: cannot import name 'MutableMapping' from 'collections' #154

Closed B34n2 closed 2 years ago

B34n2 commented 2 years ago

image

B34n2 commented 2 years ago

Found reason, was using python 3.9 and not supported version. Switched to 3.6.

macfreek commented 2 years ago

I'm reopening this issue. We should support Python 3.10.

einekratzekatze commented 2 years ago

https://github.com/twoolie/NBT/pull/156

macfreek commented 2 years ago

Please test branch fix-python-3.10 and report if that works with Python 3.10. If so, it will be pushed to master.

Fenixin commented 2 years ago

Just tested the branch in regionfixer with all the worlds (new and old) that I've got using python 3.10 and it seems to work for me.

JoshuaVandaele commented 2 years ago

It seems to be working, will this be pushed into the main branch?

JakobDev commented 2 years ago

I can also confirm that the fix-python-3.10 branch is working. So It's time for a update on PyPI.

Synergetic00 commented 2 years ago

Bash shell script to fix errors, since people aren't merging yet..

find $LOCALAPPDATA\\Programs\\Python\\Python310\\Lib\\site-packages\\nbt -name '*.py' -type f -print0 | xargs -0 sed -i 's|from collections |from collections.abc |g'
macfreek commented 2 years ago

Fix is merged. It is also pushed as a bug-fix (1.5.1) to PyPi.

@einekratzekatze Thanks for raising this issue and proposing a fix! @Synergetic00 Thanks for stepping it up a notch, and providing a work-around while we were lagging with the merge. @FolfyBlue, @JakobDev thanks for taking the time to test the fix.

If any of you is interested of continuing to support NBT, please speak to @twoolie. I know both he and I would be thrilled with some more knowledgable eyes on the code (since neither of us is active Minecraft players at the moment).