【发布时间】:2019-05-20 06:10:09
【问题描述】:
即使安装了 canmatrix 模块,Python 解释器也会抛出以下错误:
ModuleNotFoundError: No module named 'canmatrix'
我已经从源代码安装了一个 python 包 (https://github.com/ebroecker/canmatrix),其中包含以下内容: sudo python3 ~/test/canmatrix/setup.py install --prefix=/home/user/.local
当我检查 sys.path 时,我看到它已安装:
/home/user/.local/lib/python3.6/site-packages/canmatrix-0.post653.dev0+g861b926-py3.6.egg
/usr/local/lib/python3.6/dist-packages/canmatrix-0.post653.dev0+g861b926-py3.6.egg
但是,当我尝试使用以下命令导入 canmatrix 模块时:
from canmatrix.log import setup_logger, set_log_level
我收到以下错误:
ModuleNotFoundError: No module named 'canmatrix'
有人可以解释为什么找不到该模块吗?我已将两个模块的所有者更改为用户。
【问题讨论】: