1. 安装labelme
1.1 conda新建环境,激活环境
conda create -n labelme
conda activate labelme
1.2 安装pyqt5
pip install pyqt5
(有时候可能需要别的包,一起pip安装就可以)
1.3 安装labelme
pip install labelme
1.4 终端输入:labelme
正常情况下即可正常启动labelme
2.报错及修改:
2.1 报错内容:
(labelme) >labelme
Traceback (most recent call last):
File "\Anaconda3\envs\labelme\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "\Anaconda3\envs\labelme\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "\Anaconda3\envs\labelme\Scripts\labelme.exe\__main__.py", line 4, in <module>
File "\Anaconda3\envs\labelme\lib\site-packages\labelme\__init__.py", line 17, in <module>
QT4 = QT_VERSION[0] == "4"
TypeError: 'NoneType' object is not subscriptable
2.2 可能存在的问题1:labelme和pyqt5版本不对应,可以手动对应版本安装,先卸载pyqt5
pip uninstall pyqt5
pip uninstall pyqt5-tools
然后重新安装pyqt5即可,终端输入labelme即可正常启动。
labelme安装包网址:
Releases · wkentaro/labelme · GitHub
2.3 可能存在的问题2:没有配置环境变量bashrc
使用vim打开bashrc:vim ~/.bashrc
然后添加(注意改成自己的路径):
export PATH="/home/deeplearning/anaconda3/bin/labelme:$PATH
最后:source ~/.bashrc
然后终端输入labelme,启动。