使用python和T7 labjacks时出现以下错误。
from labjack import ljm
# Open first found LabJack
handle = ljm.openS("ANY", "ANY", "ANY")
# Call eReadName to read the serial number from the LabJack.
name = "SERIAL_NUMBER"
result = ljm.eReadName(handle, name)
错误是:
Traceback (most recent call last):
File "testLJ.py", line 1, in <module>
from labjack import ljm
ImportError: No module named labjack
答案 0 :(得分:0)
如Labjack - Python for LJM - Windows, Mac, Linux所述:
说明
使用pip安装LJM Python模块,这是 通常与Python一起安装,使用以下命令:
python -m pip install labjack-ljm
或:
pip install labjack-ljm
问题排查
如果出现以下错误:
ImportError: No module named labjack
确保已安装要使用的Python版本。对于 例如,在Linux上,如果同时安装了python 2.7和3.5,则可以 使用以下命令安装到Python 3.5:
$ python3.5 -m pip labjack-ljm install