imageio / imageio-binaries

Repo to place the (relatively small) binary libraries
144 stars 139 forks source link

Unable to download 'libfreeimage-3.16.0-osx10.6.dylib' using imageio.plugins.freeimage.download() #15

Closed sreelaxmee closed 3 years ago

sreelaxmee commented 3 years ago

I am trying to read *.hdr image using imageio python library. I am using the free image plugin for imageio in order to do this.

imageio.plugins.freeimage.download()

However I get the following error even though I am connected to the internet.

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.

Development environment

MacOS 11.2.1

I even tried manually downloading the file from github but did not succeed in reading the HDR files.

FirefoxMetzger commented 3 years ago

Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)>

You are getting an SSL certificate error, which is usually a symptom of an underlying problem of the OS/python install. I'm not an expert on MacOS, but in this case, it might be that you need to perform a post-install step to give your python installation access to the necessary SSL certificates. Here is some more info on that: https://stackoverflow.com/a/42334357/6753182

Regarding the manually downloading route: where did you place the binary after download? It sounds like imageio couldn't find the library. If that is not the case, could you elaborate on your procedure?

sreelaxmee commented 3 years ago

Thank you very much for pointing out. This command solved the issue. sudo /Applications/Python\ 3.6/Install\ Certificates.command