​​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.

CSD Portfolio fails to install the CSD Python API on Windows


One reason why the API may fail to install is due to a bug with the miniconda install that we use. To determine if this is the cause of the issue, open up the InstallationLog.txt file in the CCDC installation directory and search for the phrase "recursion depth". It this reveals an error section alike

Traceback (most recent call last):
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\exceptions.py", line 1074, in _call_
return func(*args, **kwargs)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\cli\main_install.py", line 20, in execute
install(args, parser, 'install')
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\cli\install.py", line 317, in install
handle_txn(unlink_link_transaction, prefix, args, newenv)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\cli\install.py", line 346, in handle_txn
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\core\link.py", line 244, in execute
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\common\io.py", line 88, in decorated
return f(*args, **kwds)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\core\link.py", line 231, in verify
exceptions = self._verify(self.prefix_setups, self.prefix_action_groups)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\core\link.py", line 591, in _verify
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\common\io.py", line 525, in map
yield func(thing)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\core\link.py", line 411, in _verify_individual_level
error_result = axn.verify()
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\core\path_actions.py", line 959, in verify
touch(user_environments_txt_file, mkdir=True, sudo_safe=True)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\gateways\disk\update.py", line 107, in touch
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\gateways\disk_init_.py", line 82, in mkdir_p_sudo_safe
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\gateways\disk_init_.py", line 82, in mkdir_p_sudo_safe
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\gateways\disk_init_.py", line 82, in mkdir_p_sudo_safe
[Previous line repeated 975 more times]
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\site-packages\conda\gateways\disk_init_.py", line 80, in mkdir_p_sudo_safe
base_dir = dirname(path)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\ntpath.py", line 221, in dirname
return split(p)[0]
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\ntpath.py", line 184, in split
seps = _get_bothseps(p)
File "C:\PROGRA~1\CCDC\PYTHON~1\MINICO~1\lib\ntpath.py", line 35, in _get_bothseps
if isinstance(path, bytes):
RecursionError: maximum recursion depth exceeded while calling a Python object

then it is likely that you are running into this bug, which is related to erroneous settings of user home environment variables. If you have the error, check your system and user environment variables for HOME entries and ensure they are correct (or removed if not used elsewhere).

If the problem persists, a workaround is to manually install the pip CSD Python API packages, rather than using the conda packages that the CSD Portfolio installer contains.

a) Download the pip package for Windows from the links available to you

b) Start an administrative command line prompt (type cmd in the start menu and right-click to open a command line prompt as administrator)

c) Run


(where the location is the actual location of the csd-python-api folder on your system)


"%USERPROFILE%\CCDC\ccdc-software\csd-python-api\miniconda\Scripts\pip" install "<path-to>\csd-python-api-X.Y.Z-win32-64-py3.7.zip"

(where <path-to> is the location of the file you downloaded in step 1, and X.Y.Z is the version for this release, e.g. 3.0.5).

If you have other modules available in addition to the base CSD Python API package, these can then be installed in the same manner.