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

‘’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; \

‘’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"}