---
title: Configuration (latest version)
description: API reference for Configuration in the latest version of qiskit-c
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-c/config
---

# Configuration

The Qiskit C API has minimal configuration.

### QISKIT\_PYTHON\_EXTENSION

If defined before including `qiskit.h`, the header files will define all of symbols in a mode safe for use with Python extension modules. This means that all API functions will evaluate to function-pointer dereferences from a lookup table.

This is a user-defined macro and not defined by Qiskit itself.

### qk\_import

`int qk_import(void)`

Import the Qiskit C API from the Python-space [`qiskit`](/docs/api/qiskit/index#module-qiskit "qiskit") package.

You must call this once per compilation unit, before attempting to call any C API functions. Failure to do so will typically result in null-pointer dereferences at runtime.

You typically will want to do this inside your `PyInit_*` module initialization function. For example, in `my_extension.c`:

```c
#define QISKIT_PYTHON_EXTENSION
#include <Python.h>
#include <qiskit.h>

static struct PyModuleDef my_extension_mod = {
   .m_base = PyModuleDef_HEAD_INIT,
   .m_name = "my_extension",
};

PyMODINIT_FUNC PyInit_my_extension(void) {
   if (qk_import() < 0) {
      return NULL;
   }
   return PyModuleDef_Init(&my_extension_mod);
}
```

This function is only defined when [`QISKIT_PYTHON_EXTENSION`](#qiskit_python_extension "QISKIT_PYTHON_EXTENSION") was defined prior to including `qiskit.h`.

**Returns**

0 on success, negative on failure.
