Skip to content

Backend MacOSX keyboard not working #8982

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

Closed
agallenne opened this issue Aug 2, 2017 · 25 comments
Closed

Backend MacOSX keyboard not working #8982

agallenne opened this issue Aug 2, 2017 · 25 comments

Comments

@agallenne
Copy link

Hi,

I am on MacOS and using the MacOSX backend. When a plot is displayed and I want to save it, I cannot change the name or go right/left in the text entry, the keyboard is not working. It was working properly before with matplotlib 1.5.1, now I upgraded to 2.0.2 (with anaconda). For now I am using the PyQt5 backend, which is OK, but if I move my plot to my second monitor (higher resolution), the window size stays the same but not the plots which is over-zoomed :-/ Any ideas to make the MacOSX backend works or solved the "dpi" issue for PyQt5?

  • Operating System: Mac OSX 10.12.6
  • Matplotlib Version: 2.0.2
  • Python Version: 2.7.13
  • Jupyter Version (if applicable):
  • Other Libraries:
@WeatherGod
Copy link
Member

WeatherGod commented Aug 2, 2017 via email

@agallenne
Copy link
Author

Keyboard bindings are not working either. Other things like zooming seem to work correctly.

@dstansby
Copy link
Member

dstansby commented Aug 2, 2017

#8931 fixed the mixed resolution issue on Qt5. I'm not seeing the same issues as you on the OSX backend, so maybe it's a python 2 only issue.

@agallenne
Copy link
Author

Ok thank you very much. Do I have to make the changes from #8931 in the .py files myself or I can download them somewhere?

@agallenne
Copy link
Author

Well, if I copy and past the corresponding corrected file (backend_qt5.py), I have the following error when starting ipython: "ImportError: cannot import name _Backend".
Am I doing something wrong!

@anntzer
Copy link
Contributor

anntzer commented Aug 2, 2017

That file also depends on other files that have changed since 2.0.2 has been released, so just copying that file will not work. I'll let the OSX devs comment on the best way to install off master.

@tacaswell
Copy link
Member

How exactly

The problem with mac may be related related to IPython's switch from readline -> prompt toolkit (but if zoom is working, that may not be the issue).

Have you tried doing %matplotlib to make sure the event loop integration is set up correctly?

There are also issue with osx + 'framework' builds see http://matplotlib.org/faq/osx_framework.html#osxframework-faq

@agallenne
Copy link
Author

Zoom is indeed working for the macosx backend (note that I used a terminal to run python with: ipython --pylab). It worked before with previous version of matplotlib and ipython. What about PyQt5 and the changes from #8931, how can I make them work on my computer?

@WeatherGod
Copy link
Member

WeatherGod commented Aug 3, 2017 via email

@agallenne
Copy link
Author

I did it yesterday and it did not change anything unfortunately.

@agallenne
Copy link
Author

Ok, so I removed all matplotlib versions I had in my .../site-packages/ directory, and installed the fresh one. The PyQt5 mixed resolution display (#8931) issue is fixed for me now. Thanks.

@tacaswell tacaswell added this to the 2.2 (next next feature release) milestone Aug 5, 2017
@tacaswell
Copy link
Member

@mdehoon Any guidance on what is wrong with the native backend?

@tacaswell tacaswell modified the milestones: 2.1.1 (next bug fix release), 2.2 (next next feature release) Aug 5, 2017
@agallenne
Copy link
Author

Now that I removed some matplotlib versions, I have the error saying that python is not installed as a framework, so back to the link you sent.

@dstansby
Copy link
Member

dstansby commented Aug 7, 2017

With conda you can do conda install python.app, and then using pythonw in place of python at the command line should fix that problem.

@agallenne
Copy link
Author

I use ipython --pylab

@WeatherGod
Copy link
Member

WeatherGod commented Aug 7, 2017 via email

@tacaswell tacaswell modified the milestones: 2.1.1 (next bug fix release), 2.2 (next feature release) Oct 9, 2017
@dopplershift
Copy link
Contributor

I can't get IPython to run with the osx backend.

If I run a plot from the command line using pythonw, I can't reproduce any problems with the keyboard. The default keybindings work and saving a figure is fine.

@tacaswell tacaswell modified the milestones: v2.2, v2.1.1 Oct 23, 2017
@tacaswell
Copy link
Member

The issue in IPython is likely missing integration with prompt toolkit (attn @Carreau )

@jklymak
Copy link
Member

jklymak commented Nov 6, 2017

@dopplershift I can't get ipython to rin the macos backend either. It gives me the "Framework required" error...

@tacaswell
Copy link
Member

I observed this issue on a number of systems today, but did not get details of IPython / OSX versions, but mostly with mpl 2.1 (I think?).

@efiring
Copy link
Member

efiring commented Nov 8, 2017

@jklymak, in a conda environment, this works for me with matplotlib 2.1.0.post222+gad730d131 (which is just what I happen to have in that environment at the moment):

(test) efiring@manini2:~/currents/temp/merger_qt2$ pythonw `which ipython`
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul  2 2016, 17:52:12)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %matplotlib osx

In [2]: import matplotlib.pyplot as plt

In [3]: plt.plot([1,2,3,2,1])
[<matplotlib.lines.Line2D at 0x115e157b8>]

@jklymak
Copy link
Member

jklymak commented Nov 8, 2017

Ah OK, didn't think to try a magic! Thanks!

@jklymak
Copy link
Member

jklymak commented Nov 8, 2017

Oh, and the which python trick. OK that works. But...

@efiring
Copy link
Member

efiring commented Nov 8, 2017

...but the buttons don't work quite right. Very strange. Zoom and pan seem to work, but home, backwards, and forwards are erratic.

@dopplershift
Copy link
Contributor

Both the forward/back/home buttons and the keyboard events are working fine for me with the current v2.1.x branch in IPython (using %matplotlib osx). I'm going to close this out, but feel free to re-open if you find this is a problem with 2.1.1 when that is released.

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

8 participants