Skip to content

OpenCV 3.4.4 Python binding #13202

@h6197627

Description

@h6197627

In newly released OpenCV 3.4.4 python bindings installation process was changed. Now it creates new folder /usr/local/python with python binding stuff. To make it visible in python user should run setup script from this folder. However after installation I am getting error:

>>> import cv2
['/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg/cv2/../../python/cv2/python-3.6', '', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/local/lib/python3.6/dist-packages/scipy-1.1.0-py3.6-linux-x86_64.egg', '/usr/local/lib/python3.6/dist-packages/protobuf-3.6.1-py3.6-linux-x86_64.egg', '/usr/local/lib/python3.6/dist-packages/pycuda-2018.1.1-py3.6-linux-x86_64.egg', '/usr/local/lib/python3.6/dist-packages/Mako-1.0.7-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/appdirs-1.4.3-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/decorator-4.3.0-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/pytest-3.9.3-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/pytools-2018.5.2-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/MarkupSafe-1.0-py3.6-linux-x86_64.egg', '/usr/local/lib/python3.6/dist-packages/py-1.7.0-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/pluggy-0.8.0-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/more_itertools-4.3.0-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/attrs-18.2.0-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/atomicwrites-1.2.1-py3.6.egg', '/usr/local/lib/python3.6/dist-packages/numpy-1.15.4-py3.6-linux-x86_64.egg', '/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg/cv2/__init__.py", line 89, in <module>
    bootstrap()
  File "/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg/cv2/__init__.py", line 79, in bootstrap
    import cv2
  File "/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg/cv2/__init__.py", line 89, in <module>
    bootstrap()
  File "/usr/local/lib/python3.6/dist-packages/opencv-3.4.4-py3.6.egg/cv2/__init__.py", line 23, in bootstrap
    raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.

Also I have another question - is it possible to configure CMake to use only Ubuntu OS dedicated folders for python binding installation (/usr/local/lib/pythonX.X/dist-packages) without creating new non-standard directories (/usr/local/python)?

System information (version)
  • OpenCV => 3.4.4
  • Operating System / Platform => Ubuntu 18.04
  • Compiler => GCC
Steps to reproduce
  1. build OpenCV with python bindings
  2. cd /usr/local/python
  3. sudo python3 setup.py install
  4. python3
  5. import cv2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions