首页 > 解决方案 > Module not found error even though I have pip installed the module

问题描述

I am working with the CANard library which can be found here: https://github.com/normaldotcom/CANard

I have correctly pip installed the module, but I am still getting an error and I am not sure why.

Here is my code:

from canard import can, bus
from canard.hw import socketcan
from canard.file import jsondb

parser = jsondb.JsonDbParser()
b = parser.parse('test_can.json')

CHANNEL = "can0"
dev = socketcan.SocketCanDev(CHANNEL)
dev.start()

while True:
    frame = dev.recv()
    signals = b.parse_frame(frame)
    if signals:
        for s in signals:
            print(s)

Here is the error:

ModuleNotFoundError: No module named 'canard.file'

canard.file does exist in the repo... any solution to this?

Thanks to all of those who reply in advance.

标签: python-3.xcan-bus

解决方案


I was able to fix this by pip installing the git repo directly

pip install git+https://github.com/normaldotcom/CANard

推荐阅读