Skip to content

Qkit Installation

sinus edited this page Jan 8, 2025 · 2 revisions

This guide provides instructions on how to install qkit, and fix some common configuration issues.

Quickstart

(Optional, recommended) Create a virtual environment and enable it. Linux:

python -m virtualenv venv
source venv/bin/activate

Windows:

python -m virtualenv venv
.\venv\bin\activate.bat

Install qkit with pip (recommended):

pip install qkit[jupyter]

In case you which to develop qkit actively, it is recommended you clone the repository and install it as a editable package:

pip install --editable '.[jupyter,analysis]'

Run the integrated qkit installer for self-configuration. Linux:

qkit-install

Windows requires administrator privileges for some changes:

Start-Process qkit-install -Verb runAs

Congratiulations, you're done! Start qkit with the QKit Jupyter Lab Application on Linux or the 'launch.bat' batch file on Windows!

Self-Configuration Details

The self-configuration will associate .h5-files with qkit, and set the environment variables QKIT_LOCAL_CONFIG and QKIT_VENV to the correct values. It will also create the required directories for data, notebooks and logs, and it will instantiate the configuration files for Jupyter Lab and Qkit.

Custom Jupyter Lab Notebook Folder

If the notebooks folder this creates does not match your needs, you can change it by modifiying jupyter_lab_config.py:

# Set Notebook directory
notebook_dir = r'C:\notebooks' # Change this line

WARNING: You will need to migrate your local config to a parent directory of your notebooks, or point to it using the environment variable QKIT_LOCAL_CONFIG. It is possible to set this environment variable in jupyter_lab_config.py, as environment variables are inherited to process children.

Migrating from older configuration models

Previously, the configuration of qkit was located in qkit/config/local.py. As this directory is now a child of src/, you are probably not supposed to touch this file. This method is deprecated (you will receive warnings).

Instead, in a parent directory, a file named qkit_local_config.py is used to configure your environment.

To migrate, copy the code in your old local.py into the new qkit_local_config.py file. Do note, however, that the datadir and logdir paths have changed. It is recommended to use the new values. Conflicting entries in your config may need to be deleted.

Clone this wiki locally