Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyter notebook example bloch-sphere-animation - matplotlib.animation:MovieWriter avconv unavailable #64

Open
ghost opened this issue Jul 15, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 15, 2018

OS: MacOS High sierra
Python: Python 3.6.5 :: Anaconda, Inc.

I installed qutip using conda

When I run python and the following

from qutip import *
about()

I get

QuTiP: Quantum Toolbox in Python
Copyright (c) 2011 and later.
A. J. Pitchford, P. D. Nation, R. J. Johansson, A. Grimsmo, and C. Granade

QuTiP Version: 4.3.1
Numpy Version: 1.14.3
Scipy Version: 1.1.0
Cython Version: 0.28.2
Matplotlib Version: 2.2.2
Python Version: 3.6.5
Number of CPUs: 4
BLAS Info: INTEL MKL
OPENMP Installed: False
INTEL MKL Ext: True
Platform Info: Darwin (x86_64)
Installation path: /Users/xxx/anaconda3/lib/python3.6/site-packages/qutip

Then I launch the jupyter notebook and run 'bloch-sphere-animation.ipynb'

plot_animation(plot_setup, plot_result, result)

I get this

WARNING:matplotlib.animation:MovieWriter avconv unavailable.

KeyError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/PIL/Image.py in save(self, fp, format, **params)
1914 try:
-> 1915 format = EXTENSION[ext]
1916 except KeyError:

KeyError: '.mp4'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in ()
----> 1 plot_animation(plot_setup, plot_result, result)

@ghost
Copy link
Author

ghost commented Jul 15, 2018

I managed to get rid of that error by running

`
brew install libav

brew install ffmpeg
`

Now when the example runs I don't get any errors but the video is 15seconds of nothing but white screen

image

@ghost
Copy link
Author

ghost commented Jul 15, 2018

image

@MaKaili
Copy link

MaKaili commented May 14, 2019

I solve this problem by setting blit=False in plot_animation() function in ipynbtools.py file.

@alkinkaz
Copy link

Replicated this issue in Ubuntu 20.04 (WSL), also matplotlib complains about how avconv will be deprecated.

@Fat-Pigeon
Copy link

I also encountered the same problem when using an example from qutip-notebooks. I think the reason for this problem is that libav, which contains anconv, has been replaced by ffmpeg. Even after libav is installed, the problem cannot be solved. So I suggest installing ffmpeg through Anaconda:
conda install -c conda-forge ffmpeg
and then change the parameter of plot_animation() function in ipynbtools.py file:
writer="anconv" -> writer="ffmpeg"
Then I solved this problem.
By the way, the reason you got nothing but white screen maybe you activated %matplotlib inline unintentionally, it's on the first line of the qutip-notebook, which also bothered me for a long time. You can change it to
%matplotlib notebook
or
%matplotlib tk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants