按照这里说明在docker容器里conda环境下安装了labelme GitHub - wkentaro/labelme: Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).后启动Labelme 直接segment fault coredump,按网上别人说的卸掉qtpy和pyqt5和Labelme后再重装:
conda install pyqt
pip install pyqt5
pip install labelme
再启动labelme,报新的错误:
Traceback (most recent call last):
File "__main__.py", line 9, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
File "qtpy/__init__.py", line 259, in <module>
qtpy.QtBindingsNotFoundError: No Qt bindings could be found
[94996] Failed to execute script '__main__' due to unhandled exception!
按着网上别人说的一些办法反复实验卸载和安装一些包,还是没能解决,非常困惑,以前安装过程和启动非常顺利,为何这docker容器内里就不行呢?仔细看了一下环境,发现里面安装了C++版的Qt5,推断极有可能是C++版Qt5和PyQt5的某些文件例如so库有冲突或者加载顺序先后造成的,于是试着去掉指定了加载C++版Qt5库的LD_LIBRARY_PATH环境变量设置:
unset LD_LIBRARY_PATH
再启动labelme,果然不报Qt bindings错误了,不过报了关于numpy的错误:
AttributeError: module 'numpy' has no attribute 'typeDict'
这应该是环境里已安装的numpy版本2.24不符合Labelme的要求,卸载掉,安装之前别的环境下Labelme可以跑的numpy 1.18.5,然后Labelme就可以正常启动了!
文章来源地址https://www.uudwc.com/A/dbx9o/
文章来源:https://www.uudwc.com/A/dbx9o/