现在,如果我在shell运行python3
,然后import cv2; cv2.xfeature2d
没有错误,它将被导入但是如果我激活了虚拟环境
AttributeError
将被提出
我在/usr/local/lib/python3/dist-packages/cv2.python3.....so
将cv2.so
与~/virtualenv/lib/python3.5/site-packages/
相关联,import cv2
工作正常但cv2.xfeature2d
提升了AttributeError: module 'cv2.cv2' has no attribute 'xfeature2d'