LINUX.ORG.RU

page-dewarp: The 'cv2' distribution was not found. Как исправить?

 ,


0

1

Пытаюсь воспользоваться https://github.com/mzucker/page_dewarp

$ python3
Python 3.6.5 (default, Mar 29 2018, 18:20:46) 
[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print (cv2.__version__)
3.4.1
>>>
$ page_dewarp notesB2.jpg
Traceback (most recent call last):
  File "/usr/bin/page_dewarp", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3088, in <module>
    @_call_aside
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3072, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 574, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 892, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 778, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'cv2' distribution was not found and is required by page-dewarp

Что не так?

Собрал с таким setup.py:

#!/usr/bin/env python3
from __future__ import print_function

import os
import sys
from setuptools import setup


setup(
    name="page_dewarp",
    version="0.0.1",
    author="Matt Zucker",
    description="Page dewarping and thresholding using a cubic sheet model",
    url="https://github.com/mzucker/page_dewarp",
    py_modules=["page_dewarp"],
    install_requires=[
        "numpy>=1.1.0",
        "scipy",
        "pillow",
        "cv2",
    ],
    entry_points="""
        [console_scripts]
        page_dewarp=page_dewarp:main
    """,
)

★★