微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法使用 imageio.plugins.freeimage.download() 下载“libfreeimage-3.16.0-osx10.6.dylib”

如何解决无法使用 imageio.plugins.freeimage.download() 下载“libfreeimage-3.16.0-osx10.6.dylib”

我正在尝试使用 imageio python 库读取 *.hdr 图像。为了做到这一点,我正在使用免费的 imageio 图像插件

imageio.plugins.freeimage.download()

然而,即使我已连接到互联网,我也会收到以下错误

Ascertaining binaries for: freeimage.
Imageio: 'libfreeimage-3.16.0-osx10.6.dylib' was not found on your computer; downloading it Now.
Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_Failed] certificate verify Failed (_ssl.c:847)>.
Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_Failed] certificate verify Failed (_ssl.c:847)>.
Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_Failed] certificate verify Failed (_ssl.c:847)>.
Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_Failed] certificate verify Failed (_ssl.c:847)>.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/imageio_download_bin",line 8,in <module>
    sys.exit(download_bin_main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/__main__.py",line 95,in download_bin_main
    download_bin(plugin_names=args.plugin,package_dir=args.package_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/__main__.py",line 61,in download_bin
    mod.download(directory=directory)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/plugins/_freeimage.py",line 66,in download
    get_remote_file(fname=fname,directory=directory,force_download=force_download)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/core/fetching.py",line 128,in get_remote_file
    _fetch_file(url,filename)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/core/fetching.py",line 187,in _fetch_file
    % os.path.basename(file_name)
OSError: Unable to download 'libfreeimage-3.16.0-osx10.6.dylib'. Perhaps there is a no internet connection? If there is,please report this problem.

开发环境

MacOS 11.2.1

我什至尝试从 github 手动下载文件但没有成功 读取 HDR 文件

解决方法

这个命令解决了前面提到的问题here sudo /Applications/Python\ 3.6/Install\ Certificates.command

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。