Deeplabcut: issue running imageio in step 1 (imageio installation for MacOS)

Created on 13 Jun 2018  路  7Comments  路  Source: DeepLabCut/DeepLabCut

Hi,

I am trying to set up your pipeline on Mac OS El Capitan 10.11.6. I installed Jupyter Notebook to run the first step. When I run "imageio.plugins.ffmpeg.download()" I get the following error:
"Imageio: 'ffmpeg-osx-v3.2.4' was not found on your computer; downloading it now.
Error while fetching file: Error while fetching file: Error while fetching file:

Error while fetching file:

IOError Traceback (most recent call last)
in ()
3 get_ipython().magic(u'matplotlib inline')
4 import imageio
----> 5 imageio.plugins.ffmpeg.download()
6 import matplotlib
7 import matplotlib.pyplot as plt

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/plugins/ffmpeg.pyc in download(directory, force_download)
71 get_remote_file(fname=fname,
72 directory=directory,
---> 73 force_download=force_download)
74
75

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/core/fetching.pyc in get_remote_file(fname, directory, force_download, auto)
125 return filename
126 else: # pragma: no cover
--> 127 _fetch_file(url, filename)
128 return filename
129

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/core/fetching.pyc in _fetch_file(url, file_name, print_destination)
181 raise IOError('Unable to download %r. Perhaps there is a no internet '
182 'connection? If there is, please report this problem.' %
--> 183 os.path.basename(file_name))
184
185

IOError: Unable to download 'ffmpeg-osx-v3.2.4'. Perhaps there is a no internet connection? If there is, please report this problem."

Did anything like that happen to you? Do you have a fix for it? I tried everything I could find online, but it did not help.
Thanks,
Marie

help wanted

Most helpful comment

Here is a quick update on the fix that worked for me on MacOS. It consisted in manually getting the ffmpeg certificate and package from the _Imageio GitHub repository_:

cd /Users/<username>/Library/Application\ Support/imageio
mkdir ffmpeg
cd ffmpeg
wget https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.2.4

Also I got an additional issue when running the commands with sk-image, which was easily solved by installing pillow version 5.0.0:

pip3 install pillow==5.0.0

Hope this might help.

All 7 comments

I am afraid, we are not using MacOS (but I think the code has already been used on MacOS). It seems that you also use python2.7. You should use 3.x; perhaps that solves the issue? Anyway, you could email Taiga Abe, one of the coauthors who I believe used the code on his Mac. Please send me an email and I can introduce you.

This really seems to be a imageio installation issue. So it would be great if someone else, who used it on MacOS could chip in.

Here is a quick update on the fix that worked for me on MacOS. It consisted in manually getting the ffmpeg certificate and package from the _Imageio GitHub repository_:

cd /Users/<username>/Library/Application\ Support/imageio
mkdir ffmpeg
cd ffmpeg
wget https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.2.4

Also I got an additional issue when running the commands with sk-image, which was easily solved by installing pillow version 5.0.0:

pip3 install pillow==5.0.0

Hope this might help.

I believe I ran into the same problem as you and ran the code you suggested, but used the curl command instead of wget since I'm on mac. I still got the following error...

/Users/cameronlaedtke/MLPracticeVE/bin/python /Users/cameronlaedtke/PycharmProjects/MLPractice/tSNEExample.py
Imageio: 'ffmpeg-osx-v3.2.4' was not found on your computer; downloading it now.
Error while fetching file: Error while fetching file: Error while fetching file: Traceback (most recent call last):
File "/Users/cameronlaedtke/PycharmProjects/MLPractice/tSNEExample.py", line 36, in
import moviepy.editor as mpy
File "/Users/cameronlaedtke/MLPracticeVE/lib/python3.6/site-packages/moviepy/editor.py", line 26, in
imageio.plugins.ffmpeg.download()
File "/Users/cameronlaedtke/MLPracticeVE/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 73, in download
force_download=force_download)
File "/Users/cameronlaedtke/MLPracticeVE/lib/python3.6/site-packages/imageio/core/fetching.py", line 127, in get_remote_file
_fetch_file(url, filename)
File "/Users/cameronlaedtke/MLPracticeVE/lib/python3.6/site-packages/imageio/core/fetching.py", line 183, in _fetch_file
os.path.basename(file_name))
OSError: Unable to download 'ffmpeg-osx-v3.2.4'. Perhaps there is a no internet connection? If there is, please report this problem.
Error while fetching file:

Any idea what's going on?

With respect to wget/curl. I think @maryeveh suggests to literally go to https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.2.4 (in your browser and download it manually). So that there is no ssl certificate error.

I am not an expert in differences between curl and wget, but there are some differences in the way they complete downloads (https://daniel.haxx.se/docs/curl-vs-wget.html). Maybe curl does not download everything that is needed, aka no the ssl certificate.
You can use wget on Mac (I am using a Mac). You have to install homebrew by typing the following line in your terminal: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then you type brew install wget and it should install it.
I hope this helps.

It worked. Thanks!

Glad to hear it! Happy analyses!

Was this page helpful?
0 / 5 - 0 ratings