Dar*_*rio 6 python macos opencv cmake
正如标题中提到的,升级到 MacOS 13.0 后,CMake 似乎被破坏了。
\n尝试安装需要 Cmake 的东西需要花费非常长的时间,然后会出现以下弹出窗口。
\n\xe2\x80\x9cCMake\xe2\x80\x9d is damaged and can\xe2\x80\x99t be opened. You should move it to the Trash. \n\nThis file was downloaded on an unknown date. # this txt is grey and smaller font\n\nPop-up Options\n1. Move to Trash 2. Cancel\nRun Code Online (Sandbox Code Playgroud)\n重现错误的步骤
\n克隆 EasyOCR
\n1.1 git克隆...
\n制作Python venv
\n2.0。cd EasyOCR/
\n2.1. python3 -m venv venv
\n2.2. 源 venv/bin/activate
\n2.3. 网络信息
\npython --version && pip --version\n# output \nPython 3.10.6\npip 22.3 from ... # path to venv dir\nRun Code Online (Sandbox Code Playgroud)\npip install -r requirements.txt
# requirements.txt content\ntorch\ntorchvision>=0.5\nopencv-python-headless<=4.5.4.60\nscipy\nnumpy\nPillow\nscikit-image\npython-bidi\nPyYAML\nShapely\npyclipper\nninja\nRun Code Online (Sandbox Code Playgroud)\nBuilding wheels for collected packages: opencv-python-headless\n Building wheel for opencv-python-headless (pyproject.toml) ... error\n error: subprocess-exited-with-error\n \n \xc3\x97 Building wheel for opencv-python-headless (pyproject.toml) did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [9 lines of output]\n 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\n cmkr = cmaker.CMaker(cmake_executable)\n 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__\n self.cmake_version = get_cmake_version(self.cmake_executable)\n 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\n raise SKBuildError(\n Traceback (most recent call last):\n \n Problem with the CMake installation, aborting build. CMake executable is cmake\n [end of output]\n \n note: This error originates from a subprocess, and is likely not a problem with pip.\n ERROR: Failed building wheel for opencv-python-headless\nFailed to build opencv-python-headless\nERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects\n\nRun Code Online (Sandbox Code Playgroud)\n关于如何解决或解决这个问题有什么想法吗?这是我第一次看到这个弹出窗口。
\n由于代码签名不当,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'
Run Code Online (Sandbox Code Playgroud)
由于 CMake 具有极强的向后兼容性,因此它应该是安全的。您还可以添加cmake>=3.24.2到您的requirements.txt.
| 归档时间: |
|
| 查看次数: |
1752 次 |
| 最近记录: |