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

Cannot plot inline in IPython console on Linux #2257

Closed
petebachant opened this issue Mar 18, 2015 · 30 comments
Closed

Cannot plot inline in IPython console on Linux #2257

petebachant opened this issue Mar 18, 2015 · 30 comments

Comments

@petebachant
Copy link

Using 2.3.3 with Python 3.4.3 installed via Conda. Attempting to plot via matplotlib inline in the IPython console kills the kernel. I am not having this problem on Windows.

@blink1073
Copy link
Contributor

I can confirm:

%matplotlib inline

import matplotlib.pyplot as plt

plt.plot([1,2,3])
Out[3]: [<matplotlib.lines.Line2D at 0x7fc1e46c5f60>]
It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.

@blink1073
Copy link
Contributor

Works fine with Py2.7.

@blink1073
Copy link
Contributor

...and it works fine from a standalone IPython QtConsole with Py3.4.

@blink1073
Copy link
Contributor

I used IPython 3.0.0 in both cases.

@ccordoba12
Copy link
Member

I was about to release 2.3.4 tomorrow but this seems pretty serious.

I can't reproduce it on my end with pip installed mpl 1.4.3 and Python 3.4.0. It seems to be an issue with mpl or Anaconda or both.

Edit: I'm also using IPython 3.0

@ccordoba12
Copy link
Member

Is %matplotlib qt working for you?

@petebachant
Copy link
Author

%matplotlib qt does work for me.

@blink1073
Copy link
Contributor

Also for me.

@ccordoba12
Copy link
Member

What about mpl 1.4.2 and/or Python 3.4.2?

@petebachant
Copy link
Author

Tried both (one at a time) and kernel is still dying.

@blink1073
Copy link
Contributor

Ditto.

@ccordoba12
Copy link
Member

@stonebig, have you seen this problem on WinPython?

This really seems a compilation bug to me. I don't understand what we can be doing to make the kernel crash.

What if you try to use 2.3.4dev or 2.4dev? I made some commits to change how we set the mpl backend that could help in this case...

@ccordoba12
Copy link
Member

Checking older Spyder versions (in the 2.3 series) would be useful too :-)

@petebachant
Copy link
Author

Works fine in 2.3.2.

@ccordoba12
Copy link
Member

@petebachant, great, some progress!! Could you use git bisect to detect the faulty commit?

@petebachant
Copy link
Author

I don't know how to do that; sorry! I did, however get the console to plot SVGs, and noticed this commit: ac52a4a. Maybe the dpi for PNGs is being set incorrectly?

@petebachant
Copy link
Author

I just noticed that spinbox does not work in 2.3.3.

@ccordoba12
Copy link
Member

I'll take a look at that tomorrow. Thanks a lot for the feedback @petebachant, perfect timing!

@stonebig
Copy link
Contributor

Well, I don't see the problem on winpython with python3.4.3 32 bit + Spyder 2.3.3 + Qt4.8.6 + windows 7 64bit.
(+all wheels carefully packed by Christoph Gohlke)

https://github.com/petebachant, you may check it works with IDLE, in case it is your graphic driver:

>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3])
>>> plt.show()

spyder233_check

@petebachant
Copy link
Author

I also do not have the problem on Windows, and have tried on multiple systems with different graphics drivers. An IPython Qt console can plot inline externally without a problem. I think this is a Spyder issue.

@ccordoba12
Copy link
Member

So this is on Linux? It's true that the issue title says it, but the description mentions Windows. That's why I asked @stonebig about it.

@petebachant, are you using Kubuntu, or KDE, as your main desktop, by any chance?

@petebachant
Copy link
Author

This is on Linux only (for me anyway). I have had the problem on both XFCE and Cinnamon desktops.

@ccordoba12
Copy link
Member

Could you create a new conda environment and install the new PyQt packages I'm working on? For that you need to run this command after creating the env:

conda install -c ccordoba12 pyqt

Then you need to install IPython and Spyder with

conda install pygments ipython
conda install --no-deps spyder

Try to see if this error happens in that env too

@petebachant
Copy link
Author

I gave that a try. Could not load Spyder without some additional dependencies. Once I got to that point I didn't have the IPython Qt console, which wants to downgrade Qt to install.

@ccordoba12
Copy link
Member

@blink1073, help me out here, please. Since you're able to reproduce this error, could you run git bisect or git blame to locate the faulty commit between 2.3.2 and 2.3.3?

ccordoba12 added a commit that referenced this issue Mar 19, 2015
This should have been done when fixing issue #2040, but it was only
noticed when mentioned in issue #2257
@ccordoba12
Copy link
Member

Ok, I fixed the problem with the inability to change our dpi value. This will be part of 2.3.4

@blink1073
Copy link
Contributor

Sorry Carlos, I was travelling today.

@blink1073
Copy link
Contributor

Found it:

commit 08596df5a484cce6852e193a7b938e5c200aec43
Author: Carlos Cordoba <ccordoba12@gmail.com>
Date:   Sun Feb 8 22:17:15 2015 -0500

    External Console: Fix plotting with Matplolib Tk and Gtk backends

    Fixes issue 2022
    Fixes issue 1946
    Fixes issue 1987

    - This also lets users to set their preferred mpl backend on Mac *again* when
    using PySide.
    - To solve this we moved to handle input hooks using code from IPython.
    - We also carefully decide what input hook to use according to the mpl backend
    and operating system.

@blink1073
Copy link
Contributor

Quicklink: 08596df

ccordoba12 added a commit that referenced this issue Mar 21, 2015
- Also update translations
@ccordoba12
Copy link
Member

Thanks @blink1073! It was easier to narrow down the problem after that :-)

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

No branches or pull requests

4 participants