以下是我尝试导入适用于Windows的MCC通用库Python API的方法:
import ctypes
from mcculw import ul
from mcculw.enums import InterfaceType
作为奖励,这是Python向我抛出的错误:
File "yadayada.py", line 12, in <module>
from mcculw import ul
File "D:\Python27\lib\site-packages\mcculw\ul.py", line 39, in <module>
_cbw.cbAChanInputMode.argtypes = [c_int, c_int, c_int]
File "D:\Python27\lib\ctypes\__init__.py", line 378, in __getattr__
func = self.__getitem__(name)
File "D:\Python27\lib\ctypes\__init__.py", line 383, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'cbAChanInputMode' not found
我必须承认,我有幸见证了一些比这更不言自明的错误信息。
答案 0 :(得分:0)
我刚刚通过pip安装了mcculw,但上次我更新了MCC DLL几年前。点击了我的https://www.mccdaq.com/Software-Downloads.aspx方式,下载了最新的MCC DAQ CD包,安装了它,一切都很愉快。
TL; DR:更新您的MCC DAQ软件。