Syntax error @ autoconnect.py

41 views
Skip to first unread message

Esam Ali

unread,
Oct 6, 2019, 8:05:32 PM10/6/19
to Quantum-Dynamics-Hub
Hi All,
I have issued to run code under Libra. Could you please check my syntax error?
Many thanks


  from liblibra_core import *
Traceback (most recent call last):
  File "run_namd.py", line 28, in <module>
    from libra_py import *
  File "/share/apps/python/modules/libra/build/src/libra_py/autoconnect.py", line 156
    {periodicity[it[0]][1]:8.5f}, {periodicity[it[0]][2]:8.5f}")
                                                                                ^
SyntaxError: invalid syntax

Alexey Akimov

unread,
Oct 6, 2019, 8:24:32 PM10/6/19
to Quantum-Dynamics-Hub
Hi Esam,

Thank you for letting us know about this error. Could you please provide more details that could help solve the problem - what is the python file that you tried to run? Also, do you use Python3? It won't work with Python2.

Best,
Alexey


Esam Ali

unread,
Oct 6, 2019, 9:00:25 PM10/6/19
to Quantum-Dynamics-Hub
Hi Dr. Alexey,

I have followed the instructions exactly building for python 2 and Python3. In both cases when I run the tests, I get syntax error on all examples files. 
Please see the attachment!!

Best,
Esam
pic1.jpg

Alexey Akimov

unread,
Oct 6, 2019, 9:21:23 PM10/6/19
to Quantum-Dynamics-Hub
Hi Esam,

from what I see, it seems you have Python 2 loaded. Like I said - the code does not support Python 2 anymore (cause Python 2 is gonna die in 2020). The older versions should work with Python 2, but for the current one - please try Python 3. Also, please point me to the test file you are trying to run or just attached it here. At this point, I'd say it is just the matter of Python version - 99%

Best,
Alexey

Esam Ali

unread,
Oct 6, 2019, 9:48:49 PM10/6/19
to Quantum-Dynamics-Hub
I would like to run PYXAID package under Libra. but, right now, I just make sure the Libra package is working. So, I have tested most of example codes that comes with Libra and all of them, it shows the same syntax error. 
Best,
Esam 

step2.tar.bz2

Alexey Akimov

unread,
Oct 7, 2019, 11:56:14 AM10/7/19
to Quantum-Dynamics-Hub
Esam,

You can't do this - Pyxaid and Libra are two different codes. 
In principle, it was possible to mix the capabilities of the two (Libra version before v3.0 tag), but at this point they are written for two different Python versions even. 

If you want to run Pyxaid-like calculations with Libra, you'd need to look at the libra_py/workflows/nbra module and the corresponding Jupyter notebook examples - e.g. https://github.com/Quantum-Dynamics-Hub/libra-code/tree/devel/notebooks/Example9_NAMD

In it, follow the step1_qe -> step2_qe (or step2a) -> step3 -> step4 sequence of examples. This should be the way to run Pyxaid-like calculations with other bells-and-whistles

Again - you have to use Python 3. The syntax errors you get are because you use Python 2.

Best,
Alexey
Reply all
Reply to author
Forward
0 new messages