-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
Summary
When trying to run the ELM327 emulator on Windows with Python 3.13, the emulator fails with an AttributeError.
Steps to Reproduce
# 1. Create and activate virtual environment
py -3 -m venv .venv
.venv\Scripts\activate
# 2. Install ELM327-Emulator
pip install ELM327-Emulator --no-cache-dir
# 3. Run the emulator on any port
python -m elm -p COM9 -s car --baudrate 38400Expected Behavior
The ELM327 emulator should start successfully on Windows, print the startup messages, and enter the interactive command loop without errors. Like so:
> python -m elm -p COM9 -s car --baudrate 38400
2025-09-14 15:26:51,645 - root - INFO -
ELM327 OBD-II adapter emulator v3.0.4 started on serial COM port "COM9".
Emulator scenario switched to 'car'
Welcome to the ELM327 OBD-II adapter emulator.
ELM327-emulator is running on serial COM port "COM9" with baud rate 38400.
Type help or ? to list commands.
CMD>Actual Behavior
The emulator starts, prints the initial info, but immediately crashes with an AttributeError.
> python -m elm -p COM9 -s car --baudrate 38400
2025-09-14 15:44:51,700 - root - INFO -
ELM327 OBD-II adapter emulator v3.0.4 started on serial COM port "COM9".
Emulator scenario switched to 'car'
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\__main__.py", line 18, in <module>
main()
~~~~^^
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\interpreter.py", line 1280, in main
p_elm.cmdloop_with_keyboard_interrupt(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
'Welcome to the ELM327 OBD-II adapter emulator.\n'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'ELM327-emulator is running on %s\n'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'Type help or ? to list commands.\n' % pty_name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\interpreter.py", line 951, in cmdloop_with_keyboard_interrupt
self.cmdloop(arg)
~~~~~~~~~~~~^^^^^
File "C:\Program Files\Python313\Lib\cmd.py", line 111, in cmdloop
if readline.backend == "editline":
^^^^^^^^^^^^^^^^
AttributeError: module 'readline' has no attribute 'backend'Environment
- Operating System:
Windows 10 Pro, version10.0.19045 N/A build 19045 - Python Version:
Python 3.13.4(on virtual environment) - Install Method:
pip install ELM327-Emulator --no-cache-dir - Installed packages:
> pip freeze
ELM327-emulator==3.0.4
flexcache==0.3
flexparser==0.4
lockfile==0.12.2
obd==0.7.3
Pint==0.24.4
platformdirs==4.4.0
pyreadline3==3.5.4
pyserial==3.5
python-daemon==3.1.2
PyYAML==6.0.2
typing_extensions==4.15.0Traceback
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\__main__.py", line 18, in <module>
main()
~~~~^^
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\interpreter.py", line 1280, in main
p_elm.cmdloop_with_keyboard_interrupt(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
'Welcome to the ELM327 OBD-II adapter emulator.\n'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'ELM327-emulator is running on %s\n'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'Type help or ? to list commands.\n' % pty_name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\username\Desktop\playground\.venv\Lib\site-packages\elm\interpreter.py", line 951, in cmdloop_with_keyboard_interrupt
self.cmdloop(arg)
~~~~~~~~~~~~^^^^^
File "C:\Program Files\Python313\Lib\cmd.py", line 111, in cmdloop
if readline.backend == "editline":
^^^^^^^^^^^^^^^^
AttributeError: module 'readline' has no attribute 'backend'Additional Context
- Issue seems to be caused by
pyreadline3on Windows. - Removing
pyreadline3resolves the issue. - The package is installed via
setup.pyhere. - Similar discussion: Unable to launch pdb: AttributeError: module 'readline' has no attribute 'backend' python/cpython#122756 (comment)
Metadata
Metadata
Assignees
Labels
No labels