• problems running API scripts

    is there a way to verify my installation of the CSD python API?

     

    I am having a number of problems trying to run (some) scripts and there are python components that need to be installed (e.g. matplotlib) that I am not able to install (and I dont know why I cant).  Also, I cant seem to run anything at all from the CSD python API window (opened from the shortcut provided when the 2020 suite is installed), should there be further steps to make this useful in anyway?

     

    I am growing rather frustrated in trying to figure this out so any help at this point would be greatfully received.  If there is someone that I should contact directly about this, then please feel free to point me in their direction.

  • RE: problems running API scripts

    So I have solved the first issue (the API was linked to an old instal of python, not the anaconda installed with the CSD suite), but I still have issues with other things.

     

    I dont have matlibplot installed, and cant seem to instal it either.  I have tried to run the following command, "C:\Program Files\CCDC\Python_API_2020\miniconda\python.exe -m pip install matplotlib", but this doesnt seem to do anything.  I have ran this from a conda window and it spits back the line 'C:\\Program Files\\CCDC\\Python_API_2020\\miniconda\\python.exe -m pip install matplotlib'

     

    Also as shown in the CSD API window it says the conda environment is not activated I have followed the guidance from the indicated conda site, but this doesnt activate it. The line to activate doesnt run in the API window, but does appear to run in the miniconda window.  

     

    I would have assumed that everything required to run the API would have been included with and installed along with the CSD suite

     

    Any suggestions on how to solve?

     

    P.S. I seem to be able to run scripts from windows CMD, but cant run anything from the CSD Python API window and also have issues with some scripts throughMercury 

  • problems running API scripts

    I am trying to run scripts with the python API (the scripts within Mercury e.g. welcome.py), however nothing runs.  The error emssage I receive are typically telling me that there is no module named ccdc.xxxxxxxxxxx

     

    I posted about the same issue a few months ago, but havent heard back/fixed the problem so apologies if this is a double post.

     

    Is this a known issue, or likely to be an issue with my installation?

  • RE: Script to generate a QR code for a CSD entry from Mercury

    Hi,

     

    I am trying to get this script to work, but I am having some trouble.  The error I receive is shown below:

     

    Can anyone shed some light on what I might be doing wrong or missing?

     

    "There was a problem running script 'C:/Program Files/CCDC/CSD_2020/Mercury/scripts/Generate_QR_code.py'.

    Error output is not empty
    The api wrapper was: C:/Program Files/CCDC/CSD_2020/Mercury/ccdc-apirunner-launch.cmd
    The python interpreter was: C:/Python27/python.exe
    The script was: C:/Program Files/CCDC/CSD_2020/Mercury/scripts/Generate_QR_code.py
    The arguments sent to Python were:
    BEDMIG
    C:/Mercury_API_work/BEDMIG/Generate_QR_code/2020_03_04_16_26_17/BEDMIG_Generate_QR_code.html
    C:/Mercury_API_work/BEDMIG/Generate_QR_code/2020_03_04_16_26_17/BEDMIG_Generate_QR_code.m2a
    The working directory was: C:/Mercury_API_work
    There may be useful output files in: C:/Mercury_API_work/BEDMIG/Generate_QR_code/2020_03_04_16_26_17
    stderr:
    Traceback (most recent call last):
    File "C:/Program Files/CCDC/CSD_2020/Mercury/scripts/Generate_QR_code.py", line 25, in <module>
    from mercury_interface import MercuryInterface
    File "C:\Program Files\CCDC\CSD_2020\Mercury\scripts\mercury_interface.py", line 19, in <module>
    from ccdc.utilities import ApplicationInterface
    ImportError: No module named ccdc.utilities

    stdout:"

  • searching for likely interactions with a fragment

    I would like to search for likely hydrogen-bonded coformers for a polymer fragment that I wish to study.

    there is no crystal structure for the polymer or the monomer, but I can ofcourse draw the monomer molcule or the likely accessible functionality of the polymer for searching against.

    I am not aware of a way to do this with the CSD suite, or with the API, but any sugestions will be gladly received

  • RE: Searching the database based on structure void space

    Many thanks yet again for your help.

     

    I am running the code from Mercury - I have tried running from a python IDE, but encounters an import error tryign to load CCDC module.  Should I be using something other than Mercury?

     

    I apologise for what are likely basic questions - if there is a good reference that might help me get up and running with this rather than continually pestering this forum a recommendation would be greatfully received

     

    The script now appears to complete and outputs a .m2a file.  I can open this in a text editor, but doest contain useful information, an example is shown below:

     

    {
        "options": {
            "interface_version": 3,
            "identifier": "AABHTZ",
            "selected_atoms": [

            ],
            "distances": [

            ],
            "angles": [

            ],
            "torsions": [

            ],
            "database_path": "C:/Program Files (x86)/CCDC/CSD_2018/CSD_539/as539be_ASER.sqlite",
            "program_executable_path": "C:/Program Files (x86)/CCDC/CSD_2018/Mercury/mercury.exe",
            "working_directory_path": "C:\\Users\\lpb16197\\Desktop\\CSD_void/AABHTZ/void_space/2018_04_25_22_14_44",
            "output_base": "C:\\Users\\lpb16197\\Desktop\\CSD_void/AABHTZ/void_space/2018_04_25_22_14_44/AABHTZ_void_space",
            "conquest_path": "C:\\Program Files (x86)\\CCDC\\CSD_2018\\ConQuest\\exe\\csds.exe"
        }
    }

  • RE: Searching the database based on structure void space

    Many thanks Paul, the script now runs, but it does suffer a time-out after 180 seconds of running.  I will need to investigate further before starting to grab the data I am looking to source

     

    As you may tell, this is the first time I have started to look at using the Python API

  • RE: Searching the database based on structure void space

    Dear Richard,

     

    Many thanks for this, I will hopefully be able to get this running soon after figuring out what my issue (below) is.  Looks to be python related rather than the script/CCDC system.

     

     

    Many thanks again

     

    Traceback (most recent call last):
    File "C:/Users/lpb16197/Desktop/CSD_void/void_space.py", line 3, in <module>
    from ccdc import io, utilities
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\site-packages\csd_python_api-1.5.1-py2.7.egg\ccdc\io.py", line 87, in <module>
    from ccdc.entry import Entry
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\site-packages\csd_python_api-1.5.1-py2.7.egg\ccdc\entry.py", line 50, in <module>
    from ccdc.crystal import Crystal
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\site-packages\csd_python_api-1.5.1-py2.7.egg\ccdc\crystal.py", line 39, in <module>
    from ccdc.molecule import Molecule, _file_object_factory
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\site-packages\csd_python_api-1.5.1-py2.7.egg\ccdc\molecule.py", line 73, in <module>
    from ccdc.utilities import UncertainValue, nested_class, bidirectional_dict, _detect_format
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\site-packages\csd_python_api-1.5.1-py2.7.egg\ccdc\utilities.py", line 33, in <module>
    import tempfile
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\tempfile.py", line 35, in <module>
    from random import Random as _Random
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\random.py", line 49, in <module>
    import hashlib as _hashlib
    File "C:\Program Files (x86)\CCDC\Python_API_2018\miniconda\lib\hashlib.py", line 138, in <module>
    _hashlib.openssl_md_meth_names)
    AttributeError: 'module' object has no attribute 'openssl_md_meth_names'

  • Searching the database based on structure void space

    I would like to find a way to search the CCDC database structures and rank them in order of % void space.  I have been a thread discussing this based on Rhombohedral space groups only.  Is it possible for me to perform such a search on the entire database, or might there even be a .py script out there for such a task?

     

     

    Many thanks