Skip to content

AttributeError: module 'cv2.cv2' has no attribute 'freetype' with opencv-contrib-python #243

@SIRHAMY

Description

@SIRHAMY

Expected behaviour

I'm trying to use cv2 with freetype and all the documentation basically says that you just need to pip install opencv-contrib-python in order to get this to work. But it throws an AttributeError on this line: free_type = cv2.freetype.createFreeType2()

Actual behaviour

AttributeError when trying to access freetype

Steps to reproduce

  • Create a new python file
  • create a new conda env
  • pip install opencv-contrib-python
import cv2

free_type = cv2.freetype.createFreeType2()
  • operating system: Ubuntu
  • opencv-python version: opencv-contrib-python==4.1.1.26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions