opencv-python: ModuleNotFoundError: No module named 'skbuild'
Expected behaviour
I was trying to install it with :
!{sys.executable} -m pip install --user opencv-python
Actual behaviour
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-rnhk49o3/opencv-python/setup.py", line 9, in <module>
import skbuild
ModuleNotFoundError: No module named 'skbuild'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-rnhk49o3/opencv-python/
Steps to reproduce
- Ubuntu 18 LTS
- Jupyter Notebook
- x86
- opencv-python version : to-be installed
Issue submission checklist
-
This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (6 by maintainers)
@skvark Installing scikit-build before attempting to install opencv made opencv successful on my Raspberry Pi 4. My end goal is still to get stable-baselines to function properly, and it won’t finish its install. However, it is no longer getting stopped by its opencv requirements. It is always one step forward and three steps back trying to get anything to work on Pis. I just thought I’d let you know that it at least seemed to install properly when I took care of the scikit-build requirement manually as such:
pip3 install scikit-build pip3 install opencv-python
https://github.com/skvark/opencv-python#frequently-asked-questions
Please post full list of commands you used when you encountered the error so I can try to reproduce it - if there’s some bug in how build dependencies are defined in pyproject.toml I’m happy to fix it. If there’s some bug in
pip
I will report it topip
maintainers. However, in my experience from answering tens of these questions the answer has been always too oldpip
. On arm64 architectures (and on arm in general) the story is a bit different, sincescikit-build
depends oncmake
arm64 binary which is currently broken and preventsscikit-build
from working properly.As noted above, also the original issue here was about too old
pip
: the problem was that systempip
was used instead of thejupyter-notebook
’s ownpip
(or something, I don’t know how jupyter works behind the scenes).Ubuntu and other Linux systems ship usually with very old
pip
versions (< 10) and there are usually many differentpip
executables in those systems. For example,pip
usually points to Python 2.7 andpip3
points to some Python 3 version. When you try to update those withpip
itself the update might fail due to the fact that they are provided via Linux system package repositories and not via get-pip.py. Therefore, the build should be run always in a cleanvirtualenv
with fresh tools.All this boils down to Python’s package management system. I hope it will be some day a bit simpler to use and update. See https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support for more info about how
pip
usespyproject.toml
to install build dependencies.Sure, here’s an example, on Ubuntu 18.04 LTS, x86_64, with Python 3.8 and pip 20.2.3 in a fresh virtualenv.
I got my wheel, and some simple tests indicate it’s working for me, so thank you for all your hard work. All I wanted to point out was that it (also) may NOT be related to old pip.