ubuntu安装labelme遇到的报错

使用虚拟环境创建labelme环境:

根据官方的指引,链接:GitHub - wkentaro/labelme: Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).

conda create --name=labelme python=3
source activate labelme
pip install labelme

问题1:

gcc -pthread -B /home/XXX/fxp/envs/labelme/compiler_compat -Wno-unused-
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" or 
<FILENAME>
       #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]
  
  note: 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.
╰─> matplotlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

根据百度链接:python安装matplotlib需要c编译_在Python 3.9上安装matplotlib提示需要FreeType更高版本的解决..._地理沙龙的博客-CSDN博客

 需要进行相关依赖库的安装:

sudo apt-get update
sudo apt-get install libfreetype6-dev
sudo apt-get install pkg-config
sudo apt-get install libpng12-dev
sudo apt-get install pkg-config

遇到报错2:

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)

参考链接:https://github.com/wkentaro/labelme/issues/1006

猜测是python版本太高,所以重新创立了pyhton=3.9的虚拟环境

conda create --prefix=/home/fxp/envs/labelme python=3.9 -y

最终安装成功;

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猫猫与橙子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值