PaddleOCR No module named 'libs.labelColor'

dced5bon  于 2022-10-27  发布在  其他
关注(0)|答案(7)|浏览(1223)

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

qyuhtwio

qyuhtwio2#

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

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

8fq7wneg

8fq7wneg4#

有解决这个问题的兄弟没

ma8fv8wu

ma8fv8wu5#

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.

htrmnn0y

htrmnn0y6#

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.
你好我刚才试了一下,这个办法好像不太行,这个办法不太行。请问你还修改过其他东西嘛

hgqdbh6s

hgqdbh6s7#

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__

相关问题