Knowledge Base/Canopy/Known Issues

OS X: 10.9 Mavericks, Python, & Canopy

Jonathan March
posted this on October 24, 2013, 10:19

(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-compressio...

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!

 

Comments

User photo
Kenn Herskind

Immediately after I installed Maverick, Canopy/Python slowed down to a pace that made it unusable for anything practical.

I then had a period of normal work speed (hooray), but now, after a reboot, down to snail pace (*sigh*).

Trying to figure out what is going on...

October 25, 2013, 10:18
User photo
Richard Klaver

Early adopter here too. Upgraded to Mavericks and had a complete slow down as well. I did a full uninstall of 64-Canopy and all associated files, reinstalled with the same slow experience. A simple arithmetic operation took a several seconds.

October 26, 2013, 15:56
User photo
Baris Onan

printing Hello World to the terminal and getting ready for next input takes about 15 seconds :) Wish i didn't rush the OS update. :(

Running Canopy 1.1.1.1452 64 bit version.

October 27, 2013, 05:24
User photo
Mohsen Jadidi
October 27, 2013, 07:20
User photo
Saqib Qazi

[Ed: consolidating Saqib's 2 reports. Thanks, Saqib!]

32 bit Canopy+Python slow down after upgrading to Mavericks. Uninstalled Canopy and tried installing the 64 bit version and then later the 32 bit version again - did not help. Both versions worked normally for the first few minutes however, before slowing down...

----

Thank you Jonathan, problems solve. Disabled App Nap for Canopy.app and all instances of Python.app and PythonNoDock.app in my applications folder. Not sure if I needed to do this for all of these apps, but since things seem to be running fine for now, don't want to rock the boat...

October 27, 2013, 13:22
User photo
Mike Alport

[Ed: consolidating Mike's 3 reports. Thanks, Mike!]:

Somewhat of a mixed report:

I found and checked the option "Prevent App Nap" in the Canopy App info - and also selected Canopy's Pylab backend "Inline" but it made no difference! Even tried a machine reboot.

Currently, everything in the Notebook window is very sluggish - scrolling, text selection and cell execution - and hence unusable.

But the responses in the iPython window below the Notebook, seems to be fine.

Canopy V1.1.1 (64-bit)

----

Just to add to my previous comment, opening a .py file instead of a .ipynb file does NOT produce any of the sluggishness of the latter.

i.e. editing a .py file seems fine - no problem with scrolling and text selection. Thus the problem seems to be specific to the Notebook cell environment.

----

Saqib's solution has not worked for me [ed: in Notebook]:

I disabled App Nap for Canopy (in Applications) and also for the Python and PythonNoDock apps in Canopy_64bit/System and Canopy_64bit/User.

Scrolling seems to be a little better, but text selection is still unusable.

October 27, 2013, 13:38
User photo
Conor Fleming

After upgrading directly from Snow Leopard 10.6.8 to Mavericks I also experienced this issue. Canopy would take 4 seconds to add 2+2 in the iPython terminal. 

I have just disabled 'App Nap' for Canopy, Mayavi (64-bit).app and Pylab (64-bit).app, and now Canopy seems to run fine again - both in the terminal and running scripts. 

Incidentally, I start Canopy using the 'canopy' command in Terminal.app - this is because I add some module directories to PYTHONPATH using my .bashrc file. 

October 27, 2013, 15:01
User photo
Jonathan March
Enthought

Article reorganized to highlight most promising workaround, and be clearer. No significant change in content.

October 27, 2013, 20:13
User photo
Mike Alport

I have disabled App Nap as suggested in("immediate workaround) above as well as the Pylab and Mayavi Apps in /Enthought Canopy (64-bit)/  but slow scroll in Notebook and slow text selection problems remain. Starting Canopy from terminal command also doesn't seem to work as suggested by Conor - although interestingly 2x Canopy sessions are started???

Until this is sorted, I am going to run Notebook in Safari using: 

ipython notebook --pylab=qt 

from a terminal session. This doesn't seem to have any problems.

 

October 28, 2013, 04:48
User photo
Min RK

I would recommend against using the Qt matplotlib backend for now on 10.9, as that seem to be the culprit.  The Cocoa ('macosx') or inline backends do not seem to be affected, and two-process IPython without matplotlib also appears unaffected.

If you do need to use a Qt backend, or you encounter the issue without Qt, you may want to set the global preference to avoid Python apps sleeping with AppNap:

defaults write org.python.python NSAppSleepDisabled -bool YES

 From looking at Info.plist, this should affect Canopy as well as any other Python.

October 28, 2013, 15:30
User photo
Peter Rusello

The AppNap workaround above seems to have solved the slowdown issue for me. Checking after disabling AppNap on each of the suggested applications above (Canopy, then the Python*.app applications), it seems disabling it on the User/Resources/Python.app actually solved the issue. I went ahead and disabled it on all of them though. This was running with the wx backend.

October 28, 2013, 20:43
User photo
Michael Dalby

I've had success like Peter's, by checking to disable AppNap on all five suggested applications, then restarting Canopy. 

October 29, 2013, 18:13
User photo
Fabio Lamanna

Hi all,

I've just bought a new macbook air with Mavericks already installed. I've been using Canopy only to manage packages, but I'm working with Python script outside it, on a text editor. By the way, I'm referring to the installed Enthought Canopy Python 2.7.3 Environment. Should I have to worry installing Canopy, but working outside of it? I mean, the compatibility problems affects only the Canopy application or the whole Python working environment?

Thanks for your support!

October 31, 2013, 05:49
User photo
David Protter

First I tried the above AppNap solution, but it didnt work.

Then I switched the Canopy preferences for the PyLab backend to SVG and that seems to have solved the problem, although I don't really understand what that means/what the true implications of this switch are. Good luck everyone!

October 31, 2013, 11:40
User photo
Jonathan March
Enthought

@Fabio - the Python issues referenced above will also occur outside of Canopy but do not seem severe. The IPython issues referenced above will also occur running in pylab mode with a Qt backend. Not entirely clear when else it will occur, but so far, "ipython --pylab=osx" seems to work ok.

October 31, 2013, 12:09
User photo
Jonathan March
Enthought

@David, Sorry and surprised that the NoApp solution didn't work for you. FYI, SVG ("inline") backend produces static non-interactive graphics. 

October 31, 2013, 12:21
User photo
Mike Alport

More info:

I have checked all 5 files fro No App Nap in File info, selected "wx" backend and rebooted Canopy.

The problems remain. Please can everyone adding comments be specific about just what "problems" they are referring to?

In my case the problems are:

1) Slow/jerky scrolling of the Notebook window and

2) Slow (5 seconds!) to show a highlighted 10 characters of text in the Notebook window wham that text is cursor selected.

Both these problems are not experienced when running Notebook in a browser from the terminal prompt: 

ipython notebook --pylab=qt

Either people are not referring to the same problems or there is some other difference in our configuration/environment that has not yet been identified.

October 31, 2013, 13:01
User photo
Myles Gartland

Prevented AppNap as above. It completely fixed the problem when working with the editor. The Ipython notebook is still slow (both tying and executing) however.

November 1, 2013, 17:19
User photo
Jonathan March
Enthought

Article re-written almost completely to reflect current understanding and simplest workarounds.

November 3, 2013, 22:41
User photo
Sturla Molden

Any news on when we can expect Python 2.7.6?

November 14, 2013, 17:24
User photo
Sturla Molden

Also note the compiler change from llvm-gcc-4.2.1 to clang-500.2.79. /usr/bin/gcc is now a symlink to clang, and /usr/bin/g++ is a symlink to clang++. One nasty effect of this is transition from GNU libstdc++ to clang libc++ for C++ binaries. I am not sure if Canopy is affected, but it is causing havoc for users of Homebrew, as all C++ dependencies seem to be broken. Also, the Intel C++ compiler is now binary compatible with a compiler that does not exist on Mavericks (llvm-gcc-4.2.1). If C++ libraries starts to behave strangely on Mavericks (e.g Qt and wxWidgets), the C++ standard library is among the possible culprits.

 

November 14, 2013, 17:40
User photo
Sturla Molden

Also note that to build many C extensions on Mavericks, we first have to run the undocumented system call

$ /usr/bin/xcode-select --install

This brings back many command line tools and header files that were wiped out by the upgrade to Mavericks and Xcode 5. This includes the C header files for POSIX.

November 14, 2013, 18:00
User photo
Jonathan March
Enthought

Thanks for the heads-ups, Sturla.

Canopy 1.3, scheduled for January, will include Python 2.7.6.

Canopy 1.2, scheduled for November, will include Min's fixes at https://github.com/ipython/ipython/pull/4453, unless dragons emerge from lairs. 

November 15, 2013, 11:18
User photo
Jonathan March
Enthought

Note that the OSX backend will work for Matplotlib but not for Mayavi, Enable, or Chaco. For these, the manual AppNap fix is necessary in Canopy 1.1.

 

November 17, 2013, 23:14
User photo
Jonathan March
Enthought

Update: Canopy 1.2 is now scheduled for the beginning of December. It will include Min's fixes at https://github.com/ipython/ipython/pull/4453, which appears to fix the issues with Qt and Wx pylab backends. Canopy 1.2 will not add support for the OSX backend within the Canopy GUI application because of Canopy/Mayavi/Chaco compatibility issues. (Pylab users from terminal can still use the OSX backend as always.)

November 22, 2013, 20:59
User photo
Brad Parry

Just bought a Mac today, installed Canopy and then...wtf? And found this thread -- thanks for your collective work on the issue(s). I'm guessing the poor quality rendering in matplotlib is a known issue as well? Is this expected to be resolved?

Since I use Python/Canopy extensively for research, I might return this thing if the bug fixes will seem to be an issue.....

November 23, 2013, 21:17
User photo
Jonathan March
Enthought

@Brad, actually this is the first I've heard of matplotlib rendering issues. Please send a report with screenshot to canopy.feedback@enthought.com. Which backend? Other details? Also, FYI, Ubuntu runs nicely in a Fusion VM on Mac (at least in earlier versions of OSX!)

November 24, 2013, 11:42
User photo
Sturla Molden
I have not seen any problems with Matplotlib, but I will check again :) Homebrew had a stability issue with Matplotlib which was related to Agg and Boost and the C++ stdlib issue I mentioned above. Bugfixes on Mavericks will not be a problem I think. There are just some initial problems. Python 2.7.6 and a few patches to ipython will take care of it. Just give it a cople of months. Enthought needs some time to test all their packages against Python 2.7.6. Right now it just looks more badly than it really is. Also note that turning off AppNap for Python and Canopy is not "worse" than running Python/Canopy in Mountain Lion. We should not complain about Apple implementing AppNap or retiring the old gcc-4.2.1 frontend in favor of clang-5.0. AppNap saves battery on laptops, by putting idle applications to sleep. But ipython's design with multiple processes does not play nicely with it. clang-5.0 has support for C99 and C++11 right out of the box. Intel is working on porting OpenMP to clang/llvm. That is good news for scientific developers. Anyone serious about scientific computing should have a dedicated computer or a VM (e.g. Oracle Virtualbox) with a solid Linux distro. If you depend a lot on Python/Canopy, you know where to find Red Hat or Ubuntu. Oracle Virtualbox is free (GPL), VMware Fusion is not. Both are very solid VMs.
November 24, 2013, 14:10
User photo
Jonathan March
Enthought

Min's patch also seems to fix the frontend slowdown in Canopy's integrated IPython notebook.

November 24, 2013, 16:09
User photo
Brad Parry

Thank-you for the tips Jonathan and Sturla. I'm an ex-Matlab-devotee making the transition....

I will fire an email over with a screenshot. I'm using Mavericks out of the box and last night installed the latest version Canopy.

Maybe I am being picky about the rendering. I have not tried saving my plots in any type of vector graphics format. Maybe if I save them as pdf and then view them, they will be fine...OK, I just did this. On both Mavericks and Windows 7, if I save a plot as *.pdf, the output file is really nice. However, if do something in python like:

>> plot(arange(0,10),sin(arange(0,10))

the plot that is displayed looks pixelated at all zoom levels on Mavericks compared to Windows 7. Even the text and buttons on the figure window are pixelated. But it is strange because all other text in the editor and ipython is nice and sharp.

The Canopy version I am using on Mavericks is 1.1.1.1452

November 24, 2013, 16:47
User photo
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. :)
November 24, 2013, 18:55
User photo
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?

November 25, 2013, 13:30
User photo
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.

November 25, 2013, 18:40
User photo
Christian Richard Greiss

Hi all,

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

Rick

December 11, 2013, 03:57
User photo
Jonathan March
Enthought

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

January 2, 2014, 12:44
User photo
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%2...

January 6, 2014, 07:49
User photo
Jonathan March
Enthought

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

January 7, 2014, 10:28
User photo
Jonathan March
Enthought
January 7, 2014, 10:30
User photo
Sturla Molden
Any news on Python 2.7.6?
January 7, 2014, 15:20
User photo
Jonathan March
Enthought

@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."

January 7, 2014, 15:25
User photo
Jonathan March
Enthought

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

January 13, 2014, 09:54
User photo
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?

January 14, 2014, 17:43
User photo
Jonathan March
Enthought

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

January 14, 2014, 17:50
User photo
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.

January 14, 2014, 17:56
User photo
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. 

 

January 29, 2014, 15:37
User photo
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.

 

January 29, 2014, 23:50
User photo
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.

February 4, 2014, 05:20
User photo
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. 

February 4, 2014, 21:40
User photo
Sturla Molden

Just a quick note:

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

February 8, 2014, 07:32
User photo
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.
February 11, 2014, 06:10
User photo
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. 

February 11, 2014, 19:40
User photo
Jonathan March
Enthought

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.

February 12, 2014, 17:37
User photo
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!

March 15, 2014, 05:09
User photo
Jonathan March
Enthought

@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-ab...

March 17, 2014, 13:37
User photo
Jonathan March
Enthought

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

January 21, 2015, 15:28