【发布时间】:2020-11-02 09:45:53
【问题描述】:
我尝试导入 Emgu.CV 但失败了。
环境: Ubuntu 20.04, 蟒蛇网, 单声道
代码如下:
import numpy as np
from PIL import Image
import clr
clr.AddReference('Emgu.CV')
from Emgu.CV import *
然后这里是错误信息:
Unhandled Exception:
System.TypeLoadException: Could not resolve type with token 01000019 from typeref (expected class 'System.Drawing.Size' in assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at System.Reflection.MonoMethodInfo.GetDeclaringType (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at System.Reflection.RuntimeMethodInfo.get_DeclaringType () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at Python.Runtime.ClassManager.GetClassInfo (System.Type type) [0x00035] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ClassManager.InitClassBase (System.Type type, Python.Runtime.ClassBase impl) [0x00000] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ClassManager.GetClass (System.Type type) [0x00028] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x0008e] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x00130] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.LoadNames () [0x00047] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ImportHook.__import__ (System.IntPtr self, System.IntPtr args, System.IntPtr kw) [0x00301] in <5796c913ef894471b5861e1a904d8918>:0
at (wrapper native-to-managed) Python.Runtime.ImportHook.__import__(intptr,intptr,intptr)
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 01000019 from typeref (expected class 'System.Drawing.Size' in assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at System.Reflection.MonoMethodInfo.GetDeclaringType (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at System.Reflection.RuntimeMethodInfo.get_DeclaringType () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
at Python.Runtime.ClassManager.GetClassInfo (System.Type type) [0x00035] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ClassManager.InitClassBase (System.Type type, Python.Runtime.ClassBase impl) [0x00000] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ClassManager.GetClass (System.Type type) [0x00028] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x0008e] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x00130] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ModuleObject.LoadNames () [0x00047] in <5796c913ef894471b5861e1a904d8918>:0
at Python.Runtime.ImportHook.__import__ (System.IntPtr self, System.IntPtr args, System.IntPtr kw) [0x00301] in <5796c913ef894471b5861e1a904d8918>:0
at (wrapper native-to-managed) Python.Runtime.ImportHook.__import__(intptr,intptr,intptr)
【问题讨论】:
标签: python emgucv ubuntu-20.04