tk has no flags because x11 is default.ģ) Test python+matplotlib: import matplotlib Sudo port install py27-matplotlib -cairo +tkinter The steps I took to get matplotlib plotting over ssh/X11 from an OS X server (Computer A) were:ġ) Uninstall the previous macports install of matplotlib and tk: sudo port uninstall py27-matplotlibĢ) Re-install matplotlib to use X11 sudo port install tk I think this is actually the default setting when installing python using macports. It turns out macports has a tk version that uses x11. The problem was I couldn't get a backend installed that used X11. This ended up leading me to the right answer. Perhaps it was my install of QT for "macosx"? I dunno I set e('qt4agg') and figures still appear on Computer A. I explicitly downloaded and installed the X11 version.
I installed PyQt4 from source (along with QT) and it didn't help. _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. All three give the same error: Feb 22 13:00:22 Python : Set a breakpoint at CGSLogError to catch errors as they are logged.įeb 22 13:00:22 Python : This user is not allowed access to the window system right now. If I am not connected via VNC, then python will thrown an error about no displays. The GTK error: ImportError: No module named _backend_gdkīackends MacOS, TkAgg, qt5agg all work but figures display on Computer A. Would I have to install it from source? Has anyone got this working? I have not yet tried to install GTK some other way. Homebrew GTK does not support X11 anymore anyway, so even if it did install properly I don't think it will solve my problem.
I tried using GTK and GTKCairo, which did not solve my problem because I cannot get GTK to work. I can't recall all the things I have tried. e('gtk') # gtk is an example, I change it To test whether matplotlib is doing what I want I use the following python snippet: import matplotlib I'm pretty sure it is a bad idea to mix so many package handlers, but so many solutions seem to be "sudo ***** install package-name". I've tried all manor of macports and homebrew and pip combinations. This is another description of the same problem with multiple solution attempts that do not work.Īs mentioned, I have tried a lot of solutions in terms of installing backends for matplotlib on Computer A. I cannot comment so I'm stuck putting what I've tried in a new question. I believe my problem is the same as this problem: none of the package installers support X11 backends for matplotlib. I am convinced it is not Computer B that is the problem. I can connect Computer B to a third computer, running Red Hat, and plots will display on Computer B. I can ssh -X/-Y into Computer A and run xcalc and it will display on computer B. The problem I am having is that when I use matplotlib the plots only display on Computer A. I have computer A and I am trying to use matplotlib to plot on computer B. Matplotlib-3.5.1-cp37-cp37m-macosx_10_9_x86_64.Summary: How do I plot figures, over SSH, to a remote computer when the local computer is running OS X? Files for matplotlib, version 3.5.1 Filename, size If you're not sure which to choose, learn more about installing packages.