错误
ImportError: /usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8
解决办法
在python前面加上
LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1
如
LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1 python3
每次使用cv2都要加,永久的解决办法还不清除,有直到的童鞋告知一下
更多可见https://github.com/piwheels/packages/issues/59
有人说
Seems you can add "export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1" to the file .bashrc in home directory, follow this by "source .bashrc". After making this mod, launch Python3 and then import cv2 and you will get no error.
个人试了一下不行,你们可以试试。 但是Be careful. This solution is really dangerous and loads the libatomic library into every binary that you run...