PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

No module named 'libs.labelColor'

Open linoqui14 opened this issue 2 years ago • 7 comments

I just don't know why -_-

Traceback (most recent call last):
  File "C:\Users\Aquiko\miniconda3\envs\open-mmlab\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Aquiko\miniconda3\envs\open-mmlab\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Aquiko\miniconda3\envs\open-mmlab\Scripts\PPOCRLabel.exe\__main__.py", line 4, in <module>
  File "C:\Users\Aquiko\miniconda3\envs\open-mmlab\lib\site-packages\PPOCRLabel\PPOCRLabel.py", line 43, in <module>
    from libs.labelColor import label_colormap
ModuleNotFoundError: No module named 'libs.labelColor'

I just install it, I followed the instruction and when I try to run it, it will cause an error

linoqui14 avatar Jun 15 '22 19:06 linoqui14

https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.5/PPOCRLabel/libs/labelColor.py

Is labelColor.py in your directory?

LDOUBLEV avatar Jun 16 '22 09:06 LDOUBLEV

https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.5/PPOCRLabel/libs/labelColor.py

Is labelColor.py in your directory? 找了找,发现labelColor.py 在PPOCRLabel/libs/下面,但是还报错!

lingyiliu016 avatar Aug 08 '22 06:08 lingyiliu016

image image

lingyiliu016 avatar Aug 08 '22 06:08 lingyiliu016

有解决这个问题的兄弟没

zhaohengmaster avatar Sep 02 '22 06:09 zhaohengmaster

I finally solve this problem. Please only install labelImg or PPOCRLabel one, because both of them have libs python package installed from pip.

For labelImg:

/home/xxx/.local/bin/labelImg
    /home/xxx/.local/lib/python3.8/site-packages/labelImg-1.8.6.dist-info/*
    /home/xxx/.local/lib/python3.8/site-packages/labelImg/*
    /home/xxx/.local/lib/python3.8/site-packages/libs/*

So run pip uninstall labelImg then run PPOCRLabel again works.

MikoyChinese avatar Sep 15 '22 09:09 MikoyChinese

I finally solve this problem. Please only install labelImg or PPOCRLabel one, because both of them have libs python package installed from pip.

For labelImg:

/home/xxx/.local/bin/labelImg
    /home/xxx/.local/lib/python3.8/site-packages/labelImg-1.8.6.dist-info/*
    /home/xxx/.local/lib/python3.8/site-packages/labelImg/*
    /home/xxx/.local/lib/python3.8/site-packages/libs/*

So run pip uninstall labelImg then run PPOCRLabel again works. 你好我刚才试了一下,这个办法好像不太行,这个办法不太行。请问你还修改过其他东西嘛

AI-cv-llg avatar Oct 12 '22 06:10 AI-cv-llg

Maybe you shou try print your libs path or file(run python not in PPOCRLabel package, should in other path).

import libs
print(libs.__path__)  # or libs.__file__

MikoyChinese avatar Oct 14 '22 05:10 MikoyChinese

进入安装PPOCRLabel环境的,找到PPOCRLabel.py 地址(我的在如下地址 \Lib\site-packages\PPOCRLabel\),使用python PPOCRLabel.py 运行这个脚本可以打开这个工具。不会报上面那个错。

morehire avatar Jul 20 '23 00:07 morehire

有解决这个问题的兄弟没

我这边是与labelimg冲突了。把PPOCRLabel的libs文件夹改为libs2。同时把代码内所有关于libs的引用改为libs2就可以了。 I am experiencing a conflict with labelimg here. Change the 'libs' folder in PPOCRLabel to 'libs2'. At the same time, change all the references to 'libs' within the code to 'libs2', and it should work.

Lavi23333 avatar Mar 02 '24 09:03 Lavi23333