python-can icon indicating copy to clipboard operation
python-can copied to clipboard

can.exceptions.CanInterfaceNotImplementedError: Unknown interface type "None"

Open alicera opened this issue 2 years ago • 1 comments

Describe the bug

Traceback (most recent call last):
  File "receive_all.py", line 34, in <module>
    receive_all()
  File "receive_all.py", line 16, in receive_all
    with can.Bus() as bus:
  File "/opt/conda/lib/python3.8/site-packages/can/interface.py", line 108, in __new__
    kwargs = load_config(config=kwargs, context=context)
  File "/opt/conda/lib/python3.8/site-packages/can/util.py", line 192, in load_config
    bus_config = _create_bus_config(config)
  File "/opt/conda/lib/python3.8/site-packages/can/util.py", line 211, in _create_bus_config
    raise CanInterfaceNotImplementedError(
can.exceptions.CanInterfaceNotImplementedError: Unknown interface type "None"

To Reproduce

pip install python-can
cd python-can/examples
python3 receive_all.py 

Expected behavior

alicera avatar Apr 23 '23 11:04 alicera

There's a comment in that example which says

    # this uses the default configuration (for example from environment variables, or a
    # config file) see https://python-can.readthedocs.io/en/stable/configuration.html

You need an existing configuration to use can.Bus() without any parameters.

zariiii9003 avatar Apr 23 '23 13:04 zariiii9003