Error installing libwebp

本文介绍了一种解决在iOS项目中使用SDWebImage时遇到的WebP兼容性问题的方法。当尝试安装libwebp时出现错误,通过修改本地Host文件成功解决了此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

项目之前一直使用SDWebImage,现在要兼容WebP,但一直报错

[!] Error installing libwebp
[!] /usr/local/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/9d/jkc05y752h1csv8s91s27pg80000gn/T/d20170503-52118-q8kwcb --template= --single-branch --depth 1 --branch v0.5.1

Cloning into '/var/folders/9d/jkc05y752h1csv8s91s27pg80000gn/T/d20170503-52118-q8kwcb'...
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out

网上很多说翻墙的,但实测翻墙无效!!!

解决思路:修改本机的Host文件

找到一份可用的Host文件(若该地址无法打开可点击这里复制),然后覆盖本机原先的Host(本机本间地址/etc/hosts)文件。

注:我们是没有权限编辑etc/hosts文件的,但我们可以先删除该文件,然后重新添加新的hosts文件

然后重新执行pod install,实测有效
这里写图片描述

Collecting tesserocr==2.8.0 Downloading tesserocr-2.8.0.tar.gz (72 kB) 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 'error' error: subprocess-exited-with-error Getting requirements to build wheel did not run successfully. exit code: 1 [54 lines of output] Failed to extract tesseract version number from: tesseract v5.5.0.20241111 leptonica-1.85.0 libgif 5.2.2 : libjpeg 8d (libjpeg-turbo 3.0.4) : libpng 1.6.44 : libtiff 4.7.0 : zlib 1.3.1 : libwebp 1.4.0 : libopenjp2 2.5.2 Found AVX2 Found AVX Found FMA Found SSE4.1 Found libarchive 3.7.7 zlib/1.3.1 liblzma/5.6.3 bz2lib/1.0.8 liblz4/1.10.0 libzstd/1.5.6 Found libcurl/8.11.0 Schannel zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 Supporting tesseract v3.04.00 Tesseract major version 3 Traceback (most recent call last): File "<string>", line 239, in get_build_args File "<string>", line 105, in package_config File "D:\python3.12\Lib\subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "D:\python3.12\Lib\subprocess.py", line 1538, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [WinError 2] ϵͳ�Ҳ���ָ�����ļ��� During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "D:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\����Դ\AppData\Local\Temp\pip-build-env-p5248zdi\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\����Դ\AppData\Local\Temp\pip-build-env-p5248zdi\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() File "C:\Users\����Դ\AppData\Local\Temp\pip-build-env-p5248zdi\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\����Դ\AppData\Local\Temp\pip-build-env-p5248zdi\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 319, in <module> File "<string>", line 254, in make_extension File "<string>", line 246, in get_build_args File "<string>", line 212, in get_tesseract_version RuntimeError: Tesseract library not found in LIBPATH: [] [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 25.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip 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.
最新发布
07-24
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值