macOS Crash When Opening Editor or Importing gdbm


  • Canopy: If user has installed python2 or python3 via Homebrew (or another package with gdbm as a dependency), then they may encounter an error in Canopy whereby clicking the Editor button from the Welcome Screen results in an immediate crash. This will also be encountered anytime the Editor window is not open but a file is opened that would normally open the Editor window - e.g. opening an IPython notebook.
  • EDM: Any code that imports gdbm that is executed from an EDM python 2.7 environment on macOS may encounter one of two errors:
    • If gdbm has been installed via Homebrew (usually as a dependency of a python2 or python3 installation) the user will see an error similar to the following:
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      ImportError: dlopen(/Users/<username>/.edm/envs/<env_name>/lib/python2.7/lib-dynload/, 2): Symbol not found: _gdbm_errno
      Referenced from: /Users/<username>/.edm/envs/<env_name>/lib/python2.7/lib-dynload/
      Expected in: /usr/local/opt/gdbm/lib/libgdbm.4.dylib
      in /Users/<username>/.edm/envs/<env_name>/lib/python2.7/lib-dynload/
    • If gdbm has not been installed via Homebrew instead the error will be:
      ImportError: dlopen(/Users/<username>/.edm/envs/test1/lib/python2.7/lib-dynload/, 2): Library not loaded: /usr/local/opt/gdbm/lib/libgdbm.4.dylib
      Referenced from: /Users/<username>/.edm/envs/test1/lib/python2.7/lib-dynload/
      Reason: image not found


The underlying cause to these issues is a bug in the python 2.7 master build used as the Canopy runtime as well as the python runtime that gets installed to new python 2.7 EDM environments. This issue does not affect Windows users, Linux users, nor does it affect python3 runtimes installed via EDM on macOS. 



We are investigating a way to address the issue in our macOS python 2.7 master build, however we do not currently have an ETA for a fix. In the meantime there are a number of workarounds to address this issue.

1. If you have Homebrew installed and have previously installed python, python3, or a python package such as pygame then those installations will have installed the package gdbm. The simplest solution is to uninstall gdbm with Homebrew:

brew uninstall gdbm

2. If you have Homebrew installed but require the gdbm package to be installed then you may be able to downgrade gdbm. This issue only occurs with gdbm version 1.14 or higher installed via Homebrew. The versions listed below have been tested to work properly; copy one of the following urls and substitute it into the command below:

  • gdbm 1.13
  • gdbm 1.12
  • gdbm 1.11 
brew unlink gdbm && brew install <URL>

3. If you do not have Homebrew installed you can address this issue by manually deleting the file from the Canopy python 2.7 runtime or the EDM python 2.7 environment. Note that this file will need to be deleted each time you create a python 2.7 environment with EDM.


To remove the file from a python 2.7 EDM environment called test-env:

rm $HOME/.edm/envs/test-env/lib/python2.7/lib-dynload/


To remove the file from the Canopy python 2.7 runtime:

mv /Applications/<>/ /Applications/<>/

Note: For the command shown above you may want to use tab-completion in your terminal as you will need to enter the exact canopy version, build, and architecture for your system. For the latest version of Canopy on macOS the full path will be:

Have more questions? Submit a request


Powered by Zendesk