​​The Cambridge Crystallographic Data Centre (CCDC).
The CCDC websites use cookies. By continuing to browse the site you are agreeing to our use of cookies. For more details about cookies and how to manage them, see our  cookie policy.

Using the CSD Python API on a system that has no display


Some aspects of the CSD Python API require an active display to be present, and by default the API will require a display to be present when importing the ccdc module. This scenario is most common when using a Linux server that has no display of its own.

If you are using the CSD Python API on a system without a display then there are a couple of options available to you to use the API:

  1. Set the environment variable CCDC_PYTHON_API_NO_QAPPLICATION to any value prior to using the API. This will allow the ccdc module to be imported, but only functionality that does not require access to a display will work (for example, diagram generation will fail as this requires a display). For example:


  2. Use a virtual display, such as that provided by xdummy and ensure the DISPLAY variable is set to use the port that the virtual display is using. This will allow full use of all functionality in the API. For example, if you have installed and run xdummy to be running on port 77, then you could use

    export DISPLAY=localhost:77