cmake 升级到MacOS 13.0后出现问题

y0u0uwnf  于 2022-11-24  发布在  Mac
关注(0)|答案(1)|浏览(229)

正如标题上提到的,CMake在升级到MacOS 13. 0后似乎坏了。
尝试安装需要Cmakes的东西需要非常长的时间,然后出现以下弹出窗口。

“CMake” is damaged and can’t be opened. You should move it to the Trash. 

This file was downloaded on an unknown date.  # this txt is grey and smaller font

Pop-up Options
1. Move to Trash  2. Cancel

重现错误的步骤
1.克隆EasyOCR
1.1 git克隆...
1.Python皮制成
2.0. cd简易OCR/
2.1.Python3-m
2.2.源venv/bin/激活
2.3.供应商信息

python --version && pip --version
# output   
Python 3.10.6
pip 22.3 from ...  # path to venv dir
  1. pip install -r requirements.txt
# requirements.txt content
torch
torchvision>=0.5
opencv-python-headless<=4.5.4.60
scipy
numpy
Pillow
scikit-image
python-bidi
PyYAML
Shapely
pyclipper
ninja

1.一段时间后,出现上述弹出窗口。单击任一选项将导致以下错误。

Building wheels for collected packages: opencv-python-headless
  Building wheel for opencv-python-headless (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for opencv-python-headless (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
        File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
          cmkr = cmaker.CMaker(cmake_executable)
        File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
          self.cmake_version = get_cmake_version(self.cmake_executable)
        File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
          raise SKBuildError(
      Traceback (most recent call last):
      
      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-headless
Failed to build opencv-python-headless
ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects

有什么想法如何解决或绕过这个问题吗?这是我第一次看到这个弹出。

ego6inou

ego6inou1#

由于不正确的代码签名,pip包在CMake 3.24.2之前的macOS 13上已损坏。您应该在虚拟环境中通过运行以下命令升级CMake:

$ python -m pip install -U pip setuptools wheel
$ python -m pip install -U 'cmake>=3.24.2'

由于CMake是 * 极其 * 向后兼容的,它应该是安全的。你也可以把cmake>=3.24.2添加到你的requirements.txt中。

相关问题