Open NFSpeedy opened 2 years ago
in files :
/.local/lib/python3.11/site-packages/pint/util.py
and
/.local/lib/python3.11/site-packages/pint/compat/chainmap.py
change :
from collections import Mapping
to
from collections.abc import Mapping
in files :
/.local/lib/python3.11/site-packages/pint/util.py
and/.local/lib/python3.11/site-packages/pint/compat/chainmap.py
change :from collections import Mapping
tofrom collections.abc import Mapping
Thanks, this works perfectly with python 3.11 Python 3.10 still complaints about something but just upgrade to 3.11 and it will work 😁
Can you send a PR with those changes?
Can you send a PR with those changes?
I would. But that has to be changed in the "Pint" package which is not part of this repo right? I see there is a "Pint" version 0.20.1 which is newer than the currently used 19 version. Maybe upgrading would solve the issue?
Ah, whoops. I didn't look closely enough.
It seems like this has been fixed in pint
awhile ago. Are you using an old version?
I simply did pip3 install obd
and got that version (19) of pint
.
I would expect this version to be set in obd, isn't it?
I've submitted a PR to update the tests to test Python 3.11, they seem to pass there: https://github.com/brendan-w/python-OBD/pull/255
I just bumped into this issue today, trying to run via python 3.10. I tried using the branch from #255 instead and it seems to be working!
Are you able to review the PR then? That will allow me to merge it
On python 3.10.9 I receive the same import error due to the deprecation of classes in collections by using the standard pip install obd.
installing the git version results in errors due to the pint package. it requires v 0.20.* but fails to import it correctly:
ImportError: cannot import name 'register_unit_format' from 'pint.formatting'
what version of pint are you using specifically?
Can you include details on what fails with the latest from git? Let's get that fixed then we can focus on a release
@alistair23 @lamemakes
Apologies for the delayed response. I was using pint 0.20.1.
I initially worked around this by reinstalling obd through the standard pip install obd. Then i manually edited pint as suggested by @Ch1x3.
I tried to reproduce the error via the github installation again but found that it now works. This is strange as the dependencies/default setup is the same.
For reference the steps I took are:
pip install git+https://github.com/brendan-w/python-OBD
I successfully installed obd-0.7.1 pint-0.20.1 and successfully imported it.
@alistair23 What's the path forward to a new release/how can I help? That'd be sweet.
@alistair23 @lamemakes
Apologies for the delayed response. I was using pint 0.20.1.
I initially worked around this by reinstalling obd through the standard pip install obd. Then i manually edited pint as suggested by @Ch1x3.
I tried to reproduce the error via the github installation again but found that it now works. This is strange as the dependencies/default setup is the same.
For reference the steps I took are:
pip install git+https://github.com/brendan-w/python-OBD
I successfully installed obd-0.7.1 pint-0.20.1 and successfully imported it.
I was wondering if it would be possible to have a new release with this patch included? It's been found to be very helpful in fixing the problem in Python 3.11.
I totally agree, especially because PyPi doesn't allow for packages to have git dependencies for security reasons (see here for an example). So a solution really needs to be hacked together for this to be included.
As mentioned before I'm willing to help however possible to get this cut and released. Cheers!
I have asked @brendan-w to push a release
released as 0.7.2
Hi,
I am using Python 3.11 and when importing obd, I get an exception:
Is Py3.11 going to be supported?