OS X: 10.9 Mavericks, Python, & Canopy

(Revised January 21, 2015 to refer to Mac crash article  - subscribe to this article for updates -- to the right of the article's title)

Summary: If you are using Mavericks, update to Canopy 1.4.1 (or higher). If you previously disabled AppNap for Python, you can re-enable it.

OS X 10.9 Mavericks was released on October 22, 2013.  There are several compatibility issues which may require fixes in Mavericks, Python, Canopy, and (IPython and/or Matplotlib and/or Qt and/or wx). The most critical issues are fixed in Canopy 1.3 and higher.

In Canopy 1.1, several partial workarounds are available, but only consider these if for some organizational reason you are not allowed to update.

Crash on waking from sleep

Please see "Canopy Crashes on Mac OS X". 

IPython Pylab/Matplotlib issues:  workarounds for Canopy 1.1

Canopy 1.2+ users can skip this section. 

IPython shell

Canopy's Python shell panel is an embedded IPython QtConsole. By default, it runs in Pylab mode, with interactive Qt as the backend. In this configuration, Pylab becomes intolerably slow for even the simplest commands, apparently because of the new "App Naps" feature in Mavericks.


1) The simplest workaround, if you do not need interactive graphics, is to change to a non-interactive backend. Go the Canopy / Preferences menu, select "Python", and under "Pylab backend", select "Inline (SVG)".

If you do need interactive graphics, you have several options:

2) Disable App Nap for Python. Open a Terminal, and type the following command (thanks to IPython's MinRK):

defaults write org.python.python NSAppSleepDisabled -bool YES

After this, the Ipython shell should run in Canopy at normal speed. 


3) Run ipython (or qtconsole) from the command line, with osx as the pylab backend (replace 64bit with 32bit if appropriate):

~/Library/Enthought/Canopy_64bit/User/bin/ipython  qtconsole  --pylab=osx

 This OSX backend will work for Matplotlib but not for Mayavi, Enable, or Chaco.

 

Fix: Canopy 1.2+'s default IPython, and its GUI application's embedded QtConsole, include MinRK's fixes at https://github.com/ipython/ipython/pull/4453, which appears to fix the backend issues for Qt and Wx.

 

IPython notebook

Canopy 1.1's Python notebook runs in Pylab mode, with interactive Qt as the backend. In this configuration, Pylab becomes intolerably slow under OS X Mavericks, apparently due to both backend and frontend interactions.

The only known workarounds are to run the ipython notebook from the command line. 


1) Easiest is to use OSX as the pylab backend (replace 64bit with 32bit if appropriate):

~/Library/Enthought/Canopy_64bit/User/bin/ipython  notebook  --pylab=osx

This OSX backend will work for Matplotlib but not for Mayavi, Enable, or Chaco.


2) To continue to use QT as the pylab backend, disable App Nap in your default browser, (Right-click in dock / Options / Show in Finder / Right-click / Info / General / Prevent App Nap.). Then:

QT_API=pyside  ~/Library/Enthought/Canopy_64bit/User/bin/ipython  notebook  --pylab=qt

 

Fix: Canopy 1.2+ GUI application's embedded notebook supports Qt, Wx, and inline backends on all platforms. Canopy 1.2+'s default IPython, and the GUI application's embedded notebook, includes MinRK's fixes at https://github.com/ipython/ipython/pull/4453, which appears to fix both frontend and backend issues for all supported backends. 

Python issues

For Python-Mavericks issues, and at least one reference to more general Mavericks issues, see this thread on the Python-Dev discussion list. These issues will not necessarily affect most Canopy users, but it's too early to be sure. The just-released Python 2.7.6 addresses these issues, and is included in Canopy 1.3 and higher.

Resources / Links

Ipython report, for discussion of IPython-Mavericks issues, and App Nap in particular.

This Macworld article includes a paragraph about App Nap, including how to disable it for a particular application.

http://www.imore.com/os-x-mavericks-review

http://reviews.cnet.com/8301-13727_7-57588576-263/memory-compression-brings-ram-doubler-to-os-x-mavericks/

http://stackoverflow.com/questions/19722580/segfault-11-with-pandas...

http://stackoverflow.com/questions/19531969/segmentation-fault-11-i...

Feedback 

If the above workarounds fail for you, or you devise other workarounds, please leave a comment below. Thanks!

Have more questions? Submit a request

Comments

  • Avatar
    Sturla Molden

    Barry, this might be because you are using the SVG pylab backend in Canopy. It does not produce so nice looking graphics as the Agg based backends. It is one of the ipython issues that will be fixed soon. :)

  • Avatar
    Michael Aye

    I would like to report something I don't understand: I upgraded to Mavericks with an installed Canopy using Python 2.7.3 and my Python/IPython is NOT crashing using readline edits? I did suffer from the slowdown in the general webbrowser notebook which I solved by using the appnap switchoff command. However, I still have the feeling that editing inside the notebook is somehow slow, sometimes the cursor just reacts very late to my inputs scrolling backwards in an input box. Anybody noticed that?

  • Avatar
    Brad Parry

    Sturla. Funny, I was thinking this looks something like svg. Had I known more about the backend in Canopy....

    Sometimes, you have a small problem, do a little search and find a much bigger problem and just assume that what you are seeing is all part of it. So easy to get sucked in with everybody else.

  • Avatar
    Christian Richard Greiss

    Hi all,

    thanks for the workarounds. Disabling App Nap brings back normal pace when running programs. Thanks for that...

    Rick

  • Avatar
    Jonathan March

    Update: Canopy 1.2 release postponed to avoid holidays, will be out next week.

  • Avatar
    Alastair Leith

    I get an error on Mavericks saying the unsigned code will not run. Any thoughts?

    https://www.dropbox.com/s/deakfbnhxxl65xh/Screenshot%202014-01-07%2000.47.03.png

  • Avatar
    Jonathan March

    Canopy 1.2 has been released. All Mavericks users (really, all users!) should update to it.

  • Avatar
    Jonathan March
  • Avatar
    Sturla Molden

    Any news on Python 2.7.6?

  • Avatar
    Jonathan March

    @Sturla: Quoting from the article: "The just-released Python 2.7.6 addresses these issues, and will be included in Canopy 1.3, scheduled for end-of-January 2014."

  • Avatar
    Jonathan March

    Tweaked article to clarify that if you previously disabled AppNap for Python, this is no longer needed with Canopy 1.2

  • Avatar
    James Bagrow

    I'm still seeing very slow notebooks under mavericks, even after updating to 1.2. Toggling app nap and changing the backend doesn't seem to make a difference. The IPython prompt pane, and the text editor, are much more responsive. Tried completely deleting and reinstalling Canopy on one machine (removing the ~/.canopy and ~/Library/Enthought/Canopy_64bit directories) without effect. Anything else I can try?

  • Avatar
    Jonathan March

    @James, is notebook also slow for you when you start it in Terminal, or only in the Canopy GUI?

  • Avatar
    James Bagrow

    It's much faster with:  $ ~/Library/Enthought/Canopy_64bit/User/bin/ipython notebook --pylab inline

    Ahh, here's a discovery: typing is only molasses when the notebook cell is Code. When it's a markdown cell, it's just as fast as in Safari.

  • Avatar
    Chris Cameron

    Canopy crashes almost every time my 2010 MBP wakes from sleep. I had the issue in 1.1 and it remains in 1.2 despite an OS re-install and complete removal and reinstall of Canopy. I talked with another user today and they have the same issue on a new MB Air. Canopy is idle when it I close the lid and crashes within a few moments of the computer waking from sleep. It happens more often if the computer has been asleep for at least a few hours. I submit 3-10 crash reports a week for this issue. I want to continue to recommend Canopy, but the lack of progress on this daily crashing issue is frustrating. 

     

  • Avatar
    Sturla Molden

    It seems OpenCV is partially broken, as Apple has deprecated QTKit in Mavericks. Canopy's OpenCV seems to be built with QTKit dependency, so components that use it do not work. E.g. cv2.VideoWriter will just produce empty files. I would advice to avoid upgrading to Mavericks if you use Python for computer vision.

    Rebuilding OpenCV without QuickTime might be a solution, but I am not sure if it will regain full functionality.

     

  • Avatar
    Mike Alport

    Since upgrading to 1.3.0, the buttons just below the menu items have all changed to "X" - on a MacBook Pro Retina, under OSX 10.9.1 - see attached.

    A reboot of the App and OS didn't seem to help.

  • Avatar
    Taylor Hines

    I followed the advised steps back in October and got Ipython Notebook working pretty well. Now with the 1.3 release I am back to the unusably slow program! I also have the same button issue that the above comment mentions. 

  • Avatar
    Sturla Molden

    Just a quick note:

    Canopy 1.3.0 has Python 2.7.6, another step towards full Mavericks compatibility.

  • Avatar
    Sturla Molden

    I am now seeing the same problem as Chris Cameron reported. The Canopy 1.3 usually (but not always) crashes when my MacBook Pro (2013) wakes from sleep.

  • Avatar
    Myles Gartland

    Ok, making progress but not there yet. I have three issues on Mavericks with 1.3 newly installed.  (I think all my comments have been mentioned by others- but still wanted to throw in my two cents).1) It crashes from time to time. 2) the ipython notebook still takes much longer to return a value, even 2+2. 3) the radio buttons on ipython notebook all have the same icon (kinda looks like an X). You have to hover to see which is which. I am attaching a screen shot. 

  • Avatar
    Jonathan March

    On the crashes, this seems to be a more general Qt issue in Mavericks, which we will patch as soon as we can (e.g. see https://bugreports.qt-project.org/browse/QTCREATORBUG-10837)

    On the notebook slowdown -- still unclear.

    On the icon buttons -- due to font changes in Mavericks (fixed a bug which Canopy was working around, such that the workaround no longer worked after the fix ;) ) -- planning to fix in Canopy 1.4.

  • Avatar
    Sixing Huang

    Hello community.

     

    I have a reproduciable canopy  - Mavericks -hanging issue. I have reinstall mavericks and then canopy 4 times now. All the same symptoms:

    After installing fresh 10.9.2 Mavericks, I immediately download canopy 1.3 with my educational license. Then I dragged the program to application and started the program. I followed the instructions and had the canopy interface. Then I quitted canopy and tried to launch the terminal. Mavericks immediately hanged. I tried to open system monitor, hanged too. Only spotlight and the mac menu bar responsed. I tried to restart through the apple icon. Dialog showed up, but after clicking, nothing happened. I had to press the power button to restart my computer.

     

    After restart, I found in the console lots of 

     

    CoreServicesUIAg Unable to quarantine 93

     

    As I said, I fresh installed Mavericks and Canopy 4 times now, all of them hanged. It is a pattern now. Even though after the hard restart, canopy is usable, but still that is very awkward for a program like canopy.

    Any advice please!! Thank you!

  • Avatar
    Jonathan March

    @Sixing Huang, Sorry for the trouble. Because of the Quarantine messages, it sounds as if Apple Gatekeeper is blocking Canopy. We have not heard of this expression of the problem before. More commonly, it (and the solution) would be as described here: https://support.enthought.com/entries/23009950-Max-OS-X-10-8-and-above-can-t-be-opened-because-it-is-from-an-unidentified-developer-

  • Avatar
    Jonathan March

    @Petia -- Updated to point to separate article "Canopy crashes on Mac OS X"

Powered by Zendesk