minibook-2nd-code
minibook-2nd-code copied to clipboard
[FIXED] matplotlib import error on a remote server
There is an error in chapter 2, in the "Downloading and loading a dataset". You must run "%matplotlib inline" before you run "import matplotlibpyplot as plt"
If you don't, you get an error on the import statement.
The order shouldn't matter; what is the exact error message?
Also the import should be import matplotlib.pyplot as plt
(there is a dot)
Sorry. Typo on the missing .
I am using ubunutu in AWS and Jupyter. See the attached screen shot for the error. If I reverse the order (I found this fix posted somewhere...can't remember where) it works fine.
Thanks! this is a bug with conda matplotlib on headless systems like AWS, and inverting the order does seem to be an easy "fix". See https://github.com/conda/conda/issues/1051. I've changed the name of the issue accordingly.
For me, switching those two does not work. I have to install pyqt4
to solve the issue.
See this answer on SO.
Good to know thanks. To install pyqt4 with conda use conda install pyqt
.