- Install the required dependencies:
sudo apt-get install python3-dev python3-pip
sudo apt-get install libopencv-dev
- Upgrade pip:
pip3 install --upgrade pip
- Install the necessary Python packages:
pip3 install numpy
pip3 install scikit-build
pip3 install opencv-python
- If the issue persists, manually install scikit-build and cmake:
pip3 install scikit-build
pip3 install cmake
- Reinstall the opencv-python package:
pip3 uninstall opencv-python
pip3 install opencv-python
- If the problem still exists, try installing the scikit-build package using the source distribution:
pip3 uninstall scikit-build
pip3 install --no-binary scikit-build scikit-build
- Reinstall opencv-python once again:
pip3 uninstall opencv-python
pip3 install opencv-python
- If the issue persists, consider upgrading setuptools:
pip3 install --upgrade setuptools
- Try installing opencv-python once more:
pip3 uninstall opencv-python
pip3 install opencv-python
- If the problem persists, you may need to manually build and install the scikit-build package:
pip3 uninstall scikit-build
git clone https://github.com/scikit-build/scikit-build.git
cd scikit-build
pip3 install .
- Reinstall opencv-python:
pip3 uninstall opencv-python
pip3 install opencv-python