赞
踩
安装labelme过程:
conda create --name=labelme python=3
conda activate labelme
pip install labelme
问题描述:
[INFO ] init:get_config:70 - Loading config file from: /home/XXX/.labelmerc
Traceback (most recent call last):
File “/home/XXX/fxp/envs/labelme/lib/python3.10/site-packages/labelme/widgets/canvas.py”, line 618, in paintEvent
p.translate(self.offsetToCenter())
File “/home/XXX/fxp/envs/labelme/lib/python3.10/site-packages/labelme/widgets/canvas.py”, line 659, in offsetToCenter
return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
QPoint(): too many arguments
QPoint(int, int): argument 1 has unexpected type ‘float’
QPoint(QPoint): argument 1 has unexpected type ‘float’
Aborted (core dumped)
解决方案:更换python版本
conda env remove -n labelme
conda create --name=labelme python=3.9
conda activate labelme
pip install labelme
问题描述:
gcc -pthread -B /home/XXX/fxp/envs/labelme/compiler_compat -Wno-unused-
#include FT_FREETYPE_H ^~~~~~~~~~~~~ src/checkdep_freetype2.c:15:9: note: #pragma message: Compiling with FreeType version FREETYPE_MAJOR.FREETYPE_MINOR.FREETYPE_PATCH. #pragma message("Compiling with FreeType version " \ ^~~~~~~ src/checkdep_freetype2.c:18:4: error: #error "FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it." #error "FreeType version 2.3 or higher is required. \ ^~~~~ error: command '/usr/bin/gcc' failed with exit code 1 [end of output]
result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem
/home/XXX/fxp/envs/labelme/include -fPIC -O2 -isystem
/home/XXX/fxp/envs/labelme/include -fPIC -DFREETYPE_BUILD_TYPE=system -
DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -
DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -
Iextern/agg24-svn/include -I/home/XXX/fxp/envs/labelme/lib/python3.10/site-
packages/numpy/core/include -I/home/XXX/fxp/envs/labelme/include/python3.10
-c src/checkdep_freetype2.c -o build/temp.linux-x86_64-cpython-
310/src/checkdep_freetype2.o
src/checkdep_freetype2.c:3:6: error: #error “FreeType version 2.3 or higher
is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let
Matplotlib download it.”
#error "FreeType version 2.3 or higher is required.
^~~~~
src/checkdep_freetype2.c:10:10: error: #include expects “FILENAME” ornote: This error originates from a subprocess, and is likely not a problem with
pip.
error: legacy-install-failure× Encountered error while trying to install package.
╰─> matplotlibnote: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
解决方案:安装对应依赖
sudo apt-get update
sudo apt-get install libfreetype6-dev
sudo apt-get install pkg-config
sudo apt-get install libpng-dev
sudo apt-get install pkg-config
两步下来最终能够在ubuntu20.04的Anaconda中成功安装labelme!
参考链接:https://blog.csdn.net/qq_22764813/article/details/126489943
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。