TypeError when importing Typestore on Python 3.10
Your Environment
Thank you for taking the time to report an issue.
To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.
-
Your operating system: Ubuntu 22.04
-
Version of python you are running (
python --version
): Python 3.10.12 -
How did you install rosbags? Did you use pip to install from PyPI or a repository checkout or something else? pip
-
Version of rosbags you have installed (
pip show rosbags | grep Version
): 0.9.20
If you're having issues with (de)serialization of custom message types please include a copy of the following:
Message definition files (msg or idl)The bytes of an example message
The Issue
Please describe the issue that you are experiencing.
On execution of a script using evo
, which imports rosbags
:
...
File ".../.venv/lib/python3.10/site-packages/evo/tools/file_interface.py", line 33, in <module>
from rosbags.rosbag1 import (Reader as Rosbag1Reader, Writer as Rosbag1Writer)
File ".../.venv/lib/python3.10/site-packages/rosbags/rosbag1/__init__.py", line 13, in <module>
from .reader import Reader, ReaderError
File ".../.venv/lib/python3.10/site-packages/rosbags/rosbag1/reader.py", line 24, in <module>
from rosbags.typesys.msg import normalize_msgtype
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/__init__.py", line 20, in <module>
from .deprecated import register_types
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/deprecated.py", line 10, in <module>
from .stores import Stores, get_typestore
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/stores/__init__.py", line 8, in <module>
from rosbags.typesys.store import Typestore
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/store.py", line 92, in <module>
class Msgdef(NamedTuple, Generic[T]):
File "/usr/lib/python3.10/typing.py", line 2330, in _namedtuple_mro_entries
raise TypeError("Multiple inheritance with NamedTuple is not supported")
TypeError: Multiple inheritance with NamedTuple is not supported
Steps to Reproduce
If the issue is predictable and consistently reproducible, please list the steps here.
- Install
rosbags==0.9.20
- Run Python 3.10
- Attempt this import:
from rosbags.typesys.store import Typestore
- See error:
(.venv) » python
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rosbags.typesys.store import Typestore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/__init__.py", line 20, in <module>
from .deprecated import register_types
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/deprecated.py", line 10, in <module>
from .stores import Stores, get_typestore
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/stores/__init__.py", line 8, in <module>
from rosbags.typesys.store import Typestore
File ".../.venv/lib/python3.10/site-packages/rosbags/typesys/store.py", line 92, in <module>
class Msgdef(NamedTuple, Generic[T]):
File "/usr/lib/python3.10/typing.py", line 2330, in _namedtuple_mro_entries
raise TypeError("Multiple inheritance with NamedTuple is not supported")
TypeError: Multiple inheritance with NamedTuple is not supported
Temporary Workaround
pip uninstall rosbags
pip install rosbags==0.9.19