Activating the CSD Python API

Modified on Mon, 6 Jul at 1:23 PM

Before using the CSD Python API you must activate it so that the system knows where to look for the Python interpreter and all its modules.

Bundled Python environment

Assuming the Python API has been installed using the CSDS installer, on Windows you can launch an interactive Python prompt from the Start menu via CCDC -> CSD Python API.

Alternatively you can run this command from a DOS command prompt so that you can run scripts using the CSD Python API:

%USERPROFILE%\CCDC\ccdc-software\csd-python-api\miniconda\Scripts\activate.bat

From a Windows Powershell use these two commands:

. %USERPROFILE%\CCDC\ccdc-software\csd-python-api\miniconda\shell\condabin\conda-hook.ps1
conda activate

If the path to either script contains a space, enclose the full path in double quotes, for example:

. "C:\Program Files\CCDC\ccdc-software\csd-python-api\miniconda\shell\condabin\conda-hook.ps1"

On Linux or MacOS run this command from a Terminal window:

source ~/CCDC/ccdc-software/csd-python-api/miniconda/bin/activate

In all commands you may need to change the path if the CSD Portfolio was installed in a non-default location.

If the activation was successful "(miniconda)" will appear at the beginning of the command prompt.

Own Python environment

If you have installed the CSD Python API into your own environment you can activate it in the usual way e.g.

conda activate environment_name

However please be aware:

  • We recommend that the CSD Portfolio is also installed - the CSD Python API requires a valid CCDC licence and much of its functionality requires the data to be installed
  • The CSD Python API locates the data via a CSD.ini config file. The easiest way to set this file up correctly is to run Mercury.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article