Have you tried using this solution from a bit of an older post?
The post was: Stackoverflow Post which was based on this blog from 2015. The way this post outlines on fixing the issue is by manually compiling OpenCV yourself. (By my understanding). You could also try checking the official docs to compile with that: OpenCV Docs
If this doesn't work however you could try just cloning the github repo (I know not the greatest way but it should work..)
$ sudo apt-get install git
$ git clone https://github.com/opencv/opencv.git