Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip install is broken (missing requirement) #372

Closed
danielgordon10 opened this issue Aug 10, 2020 · 7 comments
Closed

Pip install is broken (missing requirement) #372

danielgordon10 opened this issue Aug 10, 2020 · 7 comments

Comments

@danielgordon10
Copy link

Downloading https://files.pythonhosted.org/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz (88.0MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-exxdkf3j/opencv-python/setup.py", line 9, in <module>
        import skbuild
    ModuleNotFoundError: No module named 'skbuild'

Expected behaviour

Should be able to install.

@skvark
Copy link
Member

skvark commented Aug 10, 2020

No, it's not. Most likely your pip is too old. Upgrade with pip install --upgrade pip. However, hard to say what's the exact issue because you didn't fill the issue template and all the relevant info about your environment is missing.

@abrahamq
Copy link

abrahamq commented Aug 10, 2020

^ I had likely the same issue and your suggestion of upgrading pip fixed it:

(_test_opencv) travis@travis-job$ pip install opencv-python
Collecting opencv-python
  Using cached https://files.pythonhosted.org/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ddocw2xk/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-ddocw2xk/opencv-python/

After upgrading:

(_test_opcv) travis@travis-job:~/$ pip install --upgrade pip && pip install opencv-python
Cache entry deserialization failed, entry ignored
Collecting pip
  Using cached https://files.pythonhosted.org/packages/bd/b1/56a834acdbe23b486dea16aaf4c27ed28eb292695b90d01dff96c96597de/pip-20.2.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-20.2.1
Collecting opencv-python
  Using cached opencv_python-4.3.0.38-cp36-cp36m-manylinux2014_x86_64.whl (49.3 MB)
Collecting numpy>=1.13.3
  Using cached numpy-1.19.1-cp36-cp36m-manylinux2010_x86_64.whl (14.5 MB)
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.19.1 opencv-python-4.3.0.38

Thanks for the work that you do @skvark ! And thanks for the suggestion.

This was on Ubuntu Bionic travis image + python 3.6. I tried to create a small replication, but my team uses a pretty strange config and I couldn't get a working example together.

@skvark
Copy link
Member

skvark commented Aug 11, 2020

@abrahamq Thanks!

For anyone who might have similar issues:

The last two releases require pip version 19.3 or greater. Older pip versions do not understand the new manylinux2014 tag. Similarly, a fresh pip version is required for the source distribution build because it uses pyproject.toml and that's why the ModuleNotFoundError: No module named 'skbuild' pops up: support for PEP 517 and PEP 518 are missing.

manylinux2014 requires pip >= 19.3
manylinux2010 requires pip >= 19.0
manylinux1 requires pip >= 8.1.0

In general, it's best practice to keep pip up-to-date. See the official guide https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip.

Since 4.3.0.36 opencv-python wheels have been built as manylinux2014 wheels. This is explained also in the release notes: https://github.com/skvark/opencv-python/releases/tag/36

See this issue for more background #309

@skvark
Copy link
Member

skvark commented Aug 11, 2020

I added a FAQ entry to the README about the importance of upgrading pip: https://github.com/skvark/opencv-python#frequently-asked-questions

@Grandmother
Copy link

Hello, @skvark. Could you please help me with connected issue?

I have a project that I install directly running setup.py and upgrading pip doesn't solve my problem with ModuleNotFoundError: No module named 'skbuild' error.

@skvark
Copy link
Member

skvark commented Aug 12, 2020

If you mean the setup.py in this project, you must run the build with pip wheel . --verbose (--verbose being optional depending on do you want to see build output or not). Directly running setup.py is not supported because the build system dependencies are defined in pyproject.toml. Therefore, for example python setup.py bdist_wheel does not pick scikit-build up and the build won't succeed (#43 (comment)).

Detailed build guide is in the README: https://github.com/skvark/opencv-python#manual-builds
More reading about how modern Python packages are created: https://snarky.ca/what-the-heck-is-pyproject-toml/

@Grandmother
Copy link

Thank you very much, @skvark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants