Python / matplotlib graphics & OS X 10.9: mission control

mission-controlpython

I just got set up on OS X 10.9, and I have matplotlib working with the OS X backend, but the "python" window that shows up is partially inaccessible to Mission Control.

If I activate full Mission Control with F12 (your shortcut key may vary), it appears with the name "python".

However, there is no python icon in the Dock, and ⌘- doesn't show any icon.

Is there any way to get the python app to appear in the dock?

Best Answer

I have the same problem using Anaconda Python. The problem seems to be related to the fact that Anaconda is not a "framework" installation. For more information, see:

https://stackoverflow.com/questions/4130355/python-matplotlib-framework-under-macosx

and

https://github.com/matplotlib/matplotlib/issues/665#issuecomment-11327805

With Anaconda installed, my default python executable is Anaconda's:

$ which python
/Users/dgolden/anaconda/bin/python

A solution that works for me is to explicitly call the system python installation, which is installed in /usr/bin/python for me, e.g.,

/usr/bin/python /path/to/my/script.py

You can save yourself some typing by creating a symlink with a unique name that won't be shadowed by anaconda (the fw suffix that I use suggests "framework"):

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /usr/bin/pythonfw

Then you can run your script with:

pythonfw /path/to/my/script.py