brendan-w / python-OBD

OBD-II serial module for reading engine data
GNU General Public License v2.0
1.02k stars 360 forks source link

Incompatible with python 3.10 due to collections.MutableMapping deprecation #229

Closed j-schmied closed 2 years ago

j-schmied commented 2 years ago

Behaviour is reproducable on Windows 10/11, MacOS 11.6, Kali Linux 2021.3 and was already announced when importing MutableMapping on Python<=3.9

ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\\AppData\Local\Programs\Python\Python310\lib\collections__init__.py)

Solution: using collections.abc.MutableMapping should fix the issue (source: https://docs.python.org/3/library/collections.abc.html)

j-schmied commented 2 years ago

This seems to be an issue with pint module. It's already fixed in their GitHub repo but there seems to be no official release with the fix yet. I fixed the two files by correcting the import on my own meanwhile.

jakka351 commented 2 years ago

I got this error, was able to get library working by uninstalling all instances of one via pip uninstall obd and then re installing via pip install +git https://GitHub.com/brendan-w/python-obd@master