首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PyPy3不会安装OpenCV

PyPy3不会安装OpenCV
EN

Stack Overflow用户
提问于 2022-06-17 13:12:11
回答 1查看 302关注 0票数 0

我正在编写一个程序,将视频分割成帧,并使用opencv-python和pytesseract提取每个第n帧的文本。我设法使代码正常工作,但程序运行得相当慢。我试图使用PyPy3来提高性能,但遇到了一个问题:安装pypy的opencv库。

这是错误代码:

代码语言:javascript
复制
    Collecting opencv-python
      Using cached opencv-python-4.6.0.66.tar.gz (90.3 MB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    Requirement already satisfied: numpy>=1.14.5 in /usr/local/Cellar/pypy3/7.3.9/libexec/site-packages (from opencv-python) (1.21.6)
    Building wheels for collected packages: opencv-python
      Building wheel for opencv-python (pyproject.toml): started
      Building wheel for opencv-python (pyproject.toml): finished with status 'error'
    Failed to build opencv-python
    
    DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
      error: subprocess-exited-with-error
      
      × Building wheel for opencv-python (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [9 lines of output]
          Traceback (most recent call last):
            File "/private/var/folders/55/4bdtvdzn54n8npg5kfybcvq40000gp/T/pip-build-env-_2gw8fsy/overlay/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
              cmkr = cmaker.CMaker(cmake_executable)
            File "/private/var/folders/55/4bdtvdzn54n8npg5kfybcvq40000gp/T/pip-build-env-_2gw8fsy/overlay/site-packages/skbuild/cmaker.py", line 141, in __init__
              self.cmake_version = get_cmake_version(self.cmake_executable)
            File "/private/var/folders/55/4bdtvdzn54n8npg5kfybcvq40000gp/T/pip-build-env-_2gw8fsy/overlay/site-packages/skbuild/cmaker.py", line 96, in get_cmake_version
              "Problem with the CMake installation, aborting build. CMake executable is %s" % cmake_executable
          
          Problem with the CMake installation, aborting build. CMake executable is cmake
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for opencv-python
    ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects

我觉得我什么都试过了。我成功地安装了所有其他依赖项

代码语言:javascript
复制
pypy3 -m pip install [package]

是的,我已经把我的pip,setuptools和轮子升级到了最新的版本。

任何其他有关资料:

解释器路径:/usr/local/bin/pypy3

Python:PyPy 7.3.9 [Python 3.7.13]

OS: MacOS

我所理解的是,错误在于制造车轮,我自己读到了一些关于构建包的内容。我想不出来了。任何帮助都将不胜感激。

编辑:

我使用brew install cmake安装了cmake。现在,当我尝试安装opencv-python,而不是引发错误时,cmd会被困在

Building wheel for opencv-python (pyproject.toml) ... |

EN

回答 1

Stack Overflow用户

发布于 2022-06-17 13:19:14

错误消息声明它可能被链接到cmake,您可以尝试安装它。-> https://cmake.org/install/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72659944

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档