Coder Social home page Coder Social logo

Comments (6)

sibocw avatar sibocw commented on August 24, 2024 9

Thank you @zhanwenchen, I also encountered the same issue (even after following the StackOverflow answer above), and solved it the same way. I think the ==59.2.0 prevents pip from using the most up-to-date setuptools that has this API change addressed.

Is there a particular reason why there's such a strict requirement for setuptools? Can I make a PR to remove it (or change it to >=59.2.0)?

from opencv-python.

zhanwenchen avatar zhanwenchen commented on August 24, 2024 4

I encountered the same problem while running pip wheel . --verbose |& tee install_opencv.log. It worked after removing the ==59.2.0" from the "setuptools==59.2.0" https://github.com/opencv/opencv-python/blob/4.x/pyproject.toml#L16.

from opencv-python.

EnricoBeltramo avatar EnricoBeltramo commented on August 24, 2024 1

I already tried that and it didn't work.

from opencv-python.

asmorkalov avatar asmorkalov commented on August 24, 2024

https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean

from opencv-python.

asmorkalov avatar asmorkalov commented on August 24, 2024

#992

from opencv-python.

montmejat avatar montmejat commented on August 24, 2024

I'm also getting the same error with the latest merged updates:

Processing /home/aurelien/Projects/GitHub/opencv-python
  Running command pip subprocess to install build dependencies
  Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
  Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.10" and platform_system != "Darwin"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Darwin"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.11"' don't match your environment
  Collecting cmake>=3.1
    Using cached cmake-3.29.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.1 kB)
  Collecting numpy>=1.26.4
    Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
  Collecting pip
    Using cached pip-24.0-py3-none-any.whl.metadata (3.6 kB)
  Collecting scikit-build>=0.14.0
    Using cached scikit_build-0.17.6-py3-none-any.whl.metadata (14 kB)
  Collecting setuptools==59.2.0
    Using cached setuptools-59.2.0-py3-none-any.whl.metadata (5.0 kB)
  Collecting distro (from scikit-build>=0.14.0)
    Using cached distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
  Collecting packaging (from scikit-build>=0.14.0)
    Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
  Collecting wheel>=0.32.0 (from scikit-build>=0.14.0)
    Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
  Using cached setuptools-59.2.0-py3-none-any.whl (952 kB)
  Using cached cmake-3.29.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26.7 MB)
  Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)
  Using cached pip-24.0-py3-none-any.whl (2.1 MB)
  Using cached scikit_build-0.17.6-py3-none-any.whl (84 kB)
  Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
  Using cached distro-1.9.0-py3-none-any.whl (20 kB)
  Using cached packaging-24.1-py3-none-any.whl (53 kB)
  Installing collected packages: wheel, setuptools, pip, packaging, numpy, distro, cmake, scikit-build
  Successfully installed cmake-3.29.5 distro-1.9.0 numpy-1.26.4 packaging-24.1 pip-24.0 scikit-build-0.17.6 setuptools-59.2.0 wheel-0.43.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Traceback (most recent call last):
    File "/home/aurelien/Projects/GitHub/opencv-python/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/aurelien/Projects/GitHub/opencv-python/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/aurelien/Projects/GitHub/opencv-python/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
      backend = _build_backend()
                ^^^^^^^^^^^^^^^^
    File "/home/aurelien/Projects/GitHub/opencv-python/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
      obj = import_module(mod_path)
            ^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 995, in exec_module
    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    File "/tmp/pip-build-env-who73wyv/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
      import setuptools.version
    File "/tmp/pip-build-env-who73wyv/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
      import pkg_resources
    File "/tmp/pip-build-env-who73wyv/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
      register_finder(pkgutil.ImpImporter, find_on_path)
                      ^^^^^^^^^^^^^^^^^^^
  AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/aurelien/Projects/GitHub/opencv-python/.venv/bin/python /home/aurelien/Projects/GitHub/opencv-python/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /tmp/tmp35dh4ua_
  cwd: /home/aurelien/Projects/GitHub/opencv-python
  Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

from opencv-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.