Goodman-lab / DP5

Python workflow for DP5 and DP4 analysis of organic molecules
Other
174 stars 101 forks source link

SyntaxError: invalid syntax #89

Open jintianyun56 opened 12 months ago

jintianyun56 commented 12 months ago

Hi there, I have settings.cfg but have to change ConfPrune.pyx as ConfPrune.py, otherwise, the PyDP4.py can't find ConfPrune. I tried to run the sample AT1.sdf. Running "PyDP4.py -s chloroform -m m -B 6-311g* -F mPW1PW91 --AssumeDFTDone AT1_ AT1NMR" in the ./MM/ file show error

File "/home/tj/DP5_master/ConfPrune.py", line 37 cdef long int c1, c2 ^^^^ SyntaxError: invalid syntax

would you like to help me to fix it? Thanks

ruslankotl commented 10 months ago

It looks like you have a problem with Cython. I suggest the following workaround:

  1. delete ConfPrune.pyx from your DP5 folder
  2. download ConfPrune.txt and paste into your DP5 folder as ConfPrune.py
  3. In PyDP4.py, replace the following lines:

    if os.name == 'nt':
    import pyximport
    
    pyximport.install()
    import ConfPrune
    else:
    import pyximport
    
    pyximport.install()
    import ConfPrune

    with import ConfPrune

Let me know if this helps