[Python, pip] AttributeError: module 'clr' has no attribute 'AddReference'

想使用 DLL 文件,
需使用 clr 內的 AddReference 的函式,
因此我下了這個指令 :
  • pip install clr
下了以後發現都會跑出 :
  • AttributeError: module 'clr' has no attribute 'AddReference'
原來會噴錯的原因是因為我裝了 'clr',
其實只要安裝pythonnet即可。
  • pip uninstall clr
  • pip install pythonnet

留言

這個網誌中的熱門文章

[Qt, C++] Qt Timer 用法

[C++, Visual Studio] 解決問題 : 應用程式無法正確啟動 (0xc000007b)。請按一下 [確定] 關閉應用程式。