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
matplotlib.use('Agg')
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
matplotlib.use('TkAgg')

‘’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; \
print(os.path.dirname(DLFCN.__file__))"`:$PYTHONPATH"

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

Miniconda environment installation may fail on Windows 10 and 11

Miniconda utilises very long file paths during installation and by default Windows does not have support for long paths enabled. This can cause installation of the miniconda distribution the CSD Python API uses to fail. This could be the cause if the CSD Python API, some of its dependencies, or the example python scripts appear missing post-install.

As of release 2023.2, enabling long paths for the CSD Python API is now a requirement. If this is not set, then if running as an administrator this will be set automatically for you. If not installing as admin, then installation may fail. In release 2023.2, this failure was silent. In subsequent releases, the installation will fail with an error message directing the user to perform this fix.

Please ensure that the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled is set to 1 prior to starting the installation. If installation fails, you can resolve the problem post-install by setting the registry key, then using the maintenance tool select “Add or remove components” and click Next. Deselect the CSD Python API component to uninstall it. Once this process is complete, start the maintenance tool again, and select the CSD Python API to reinstall it.

The Aromatics Analyser may fail on RHEL 7 and CentOS 7

When using the Aromatics Analyser functionality in Mercury the calculation may fail with an error relating to the neural network calculation failing to finish. The underlying cause of this is due to a problem loading and using TensorFlow in the underlying Python code that is running. Similarly, Aromatics Analyser functionality in the CSD Python API may fail with a glibc error for the same reason.

A workaround is to set LD_LIBRARY_PATH to include the ccdc-software/csd-python-api/miniconda/lib of your installation, e.g.

export LD_LIBRARY_PATH=/path/to/ccdc/ccdc-software/csd-python-api/miniconda/lib:$LD_LIBRARY_PATH