Question: I have SDK version 25, when i import a project in android studio this error occurs. 

> 
> "Install missing platform(s) and sync project".
> 
> 
> 

If I click this link, I get another error, which says:

> 
> "The following packages are not available: - Package id
>  platforms;android-23".
> 
> 
> 

[sdk error](https://i.stack.imgur.com/hY1P2.png) 

[my SDK version](https://i.stack.imgur.com/8e89N.png)

Answer: 
Downgrade the python version from 3.9.13 to 3.8.10

```
conda install python=3.8.10

pip install opencv-python==4.5.2.54

```

worked for me.
The answer of @Mateen works great if you have Ubuntu version 17 and above. For Ubuntu 16, it's better to compile from sources your opencv python. As @Varun mentioned, follow the [opencv tutorial](https://docs.opencv.org/3.4.1/d2/de6/tutorial_py_setup_in_ubuntu.html). However, to successfully compile opencv with python 3 I have to add some flags in cmake command:

`cmake -DCMAKE_BUILD_TYPE=RELEASE -DPYTHON_DEFAULT_EXECUTABLE=$(which python3) -DPYTHON_INCLUDE_DIR2=/usr/include/x86_64-linux-gnu/python3.5m/ -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.5/dist-packages/numpy/core/include/ ..`

Hope that will be helpful.