You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd /usr/local/lib/python2.7/site-packages/
ls -lah
# lrwxr-xr-x 1 rainy admin 66B 7 3 10:30 cv2.so -> ../../../Cellar/opencv/2.4.11_1/lib/python2.7/site-packages/cv2.socd ../../../Cellar/opencv
# no such file or directory: ../../../Cellar/opencv
电脑里面一直有Python+OpenCV,最近两次不明原因的重启,之后突然发现
No module named cv2
:我的印象里,
cv2
就是编译好的一个cv2.so
,放在Python的sys.path
,先查看这个文件是否还在:再检查是不是系统路径被更改了:
然后检查Python中的
sys.path
:结果发现
/usr/local/lib/python2.7/site-packages/
路径也在,切换到这里之后,发现cv2.so
变成了一个软链接:而
/usr/local/Cellar
是Homebrew保存下载包的地方,不清楚什么时候我的cv2.so
被替换到这里。无奈只能再用Homebrew安装一次opencv:安装完检验一下
暂时没有时间研究清楚到底发生了什么,虽然相对于自己编译OpenCV的痛苦经历,Homebrew安装起来确实省事不少,可是原本安装好的文件被莫名其妙被替换掉,还是很不爽。
🍺
🍺
🍺
🍺
The text was updated successfully, but these errors were encountered: