Known issues

New issue: Matplotlib “ImportError: DLL load failed: The specified procedure could not be found.”

On Windows, when ccdc is imported before matplotlib, matplotlib will fail with the above error message.

Importing matplotlib and selecting a non-Qt rendering backend before importing ccdc works:

import matplotlib
import matplotlib.pyplot as plot
import ccdc

Attribute ccdc.entry.Entry.radiation_source returns an incorrect value for structures determined by electron radiation

Currently the radiation source has been assigned incorrectly for structures determined by electron radiation, and this attribute will return X-ray for these structures. This incorrect assignment of electron radiation occurs during the database creation process and a fix is being worked on.

To find electron diffraction structures in the CSD, the CCDC has created the CSD Electron Diffraction Subset which contains all known structures measured with electron diffraction techniques.

Diagram highlighting gives misleading results if used with shrunken symbols

When generating 2D diagrams of molecules and crystals it is recommended to set the ccdc.diagram.DiagramGenerator.Settings.shrink_symbols setting to False as it may otherwise give misleading images.

This issue does not manifest itself when using ccdc.entry.Entry where the 2D coordinates are taken from the CSD.

Diagrams have coloured rectangles in place of atom labels and group symbols

On some versions of Linux it is possible that no suitable fonts are installed for the diagram rendering code. The consequence is that the unknown character glyph is displayed for every label. Please ensure that any font matching “Helvetica” is available.

On RHEL/CentOS Linux, this can be resolved by installing the dejavu-sans-fonts package.

On macOS, creating multiple diagrams in a single session can lead to crashes

In some scripts, conflicts between matplotlib and other CSD Python API dependencies may lead to crashes during diagram generation.

Matplotlib supports multiple rendering backends. We recommend the “TkAgg” option on macOS, and this avoids the diagram generation crashes. This backend should be selected when importing the matplotlib module.

import matplotlib

Example scripts fail on Ubuntu 14 with “GLib-GIO-Message: Using the ‘memory’ GSettings backend. …”

The installed Python matplotlib package is known to not work on Ubuntu 14 due to a bug, see for further details.

While the CSD Python API will work correctly, some example scripts are expected fail. A fix is to set the GIO_EXTRA_MODULES environment variable:

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/

Numpy install fails with “error: Unable to find vcvarsall.bat”

Numpy is not required for the core CSD Python API package, but it can be optionally installed for use within some of the example scripts.

On Windows, the install may stop due to a failure during the numpy installation step. This results from the Visual C++ 2008 runtime libraries are not installed on the computer. These can be added through installation of the free Visual C++ 2008 Express Edition.

lxml install fails with “Could not find function xmlCheckVersion in library libxml2…”

On Windows, the install may stop due to failure in the lxml installation step. Near the end of the failure message is:

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

A solution to this is to manually install lxml by running lxml-3.5.0.win32-py2.7.exe downloaded from and then repeating the CSD Python API install.

‘’ImportError: No module named DLFCN’’ error during import

Virtual environments on RedHat and CentOS systems may not set the Python system path properly. This will cause the CSD Python API to fail to load with an error like ImportError: No module named DLFCN. See virtualenv Bug 874 for further details. To prevent this, you should extend the PYTHONPATH environment variable to include the directory that contains the DLFCN module.

For example, this can be achieved with the following:

export PYTHONPATH="`python -c "import DLFCN; import os.path; \

‘’ImportError: DLL load failed: %1 is not a valid Win32 application’’ error during import

On Windows, if the 64-bit version of the CSD Python API package is installed into a 32-bit python system, or the converse, a python traceback would be seen during import. If the final lines of the traceback resemble the following, please install the alternative version of the CSD Python API.

File "C:\Program Files\CCDC\Python_API_2020\miniconda\lib\site-packages\ccdc\_lib\",
line 24, in swig_import_helper
    _mod = imp.load_module('_UtilitiesLib', fp, pathname, description)
ImportError: DLL load failed: %1 is not a valid Win32 application.

‘’failed to get the current screen resources’’ message on Ubuntu 16

The above message is output following import ccdc. This is harmless and can be ignored.

Error messages including ‘’{contents = “KeyboardLayout Name”}’’ on macOS

On macOS only, messages such as the following can be output following import ccdc. These messages are harmless, but may be avoided by adding another keyboard layout in System Preferences | Keyboard | Input Sources on the macOS desktop.

python[23366:1195030] isPrefsCreateCacheFromEnabledAndDefaultInputSources - can't find anything from GetInputSourceEnabledPrefs, use defaultASCIIKeyLayoutDict = <CFBasicHash 0x7f916d44fb40 [0x7fff9314e8f0]>{type = mutable dict, count = 3, entries =>
0 : <CFString 0x7fff931b97f8 [0x7fff9314e8f0]>{contents = "InputSourceKind"} = <CFString 0x7fff931fed38 [0x7fff9314e8f0]>{contents = "Keyboard Layout"}
1 : <CFString 0x7fff931eae78 [0x7fff9314e8f0]>{contents = "KeyboardLayout ID"} = <CFNumber 0x237 [0x7fff9314e8f0]>{value = +2, type = kCFNumberSInt64Type}
9 : <CFString 0x7fff931b44f8 [0x7fff9314e8f0]>{contents = "KeyboardLayout Name"} = <CFString 0x7f916f9641d0 [0x7fff9314e8f0]>{contents = "British"}