Skip to content

Error with the example command aenet sconv vasprun.xml final_structure.xsf #5

Description

@JQmasters

Error message was:

Traceback (most recent call last):
  File "/Users/jianzhou/.local/bin/aenet", line 30, in <module>
    args.run(args)
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/commandline/aenet_sconv.py", line 231, in run
    self.sconvert(infile=args.input_file,
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/commandline/aenet_sconv.py", line 465, in sconvert
    struc = self. read_input_structure(
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/commandline/aenet_sconv.py", line 290, in read_input_structure
    struc = structure.read_safely(infile, frmt=infrmt, **kwargs)
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/io/structure.py", line 87, in read_safely
    struc = read(filename, frmt=frmt, **kwargs)
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/io/structure.py", line 78, in read
    return formats[frmt].read(filename, **kwargs)
  File "/Users/jianzhou/.local/lib/python3.9/site-packages/aenet/formats/vasp.py", line 214, in read
    if has_lxml:
NameError: name 'has_lxml' is not defined

I tried to debug it:

In the ../aenet/formats/vasp.py file, line 11

try:
       from lxml import etree
       has_lxml = True
except ImportError:
       import xml.etree.cElementTree as ET

As I didn't install lxml package, the variable has_lxml is not defined. Thus on the line 214:

if has_lxml:
             parser = etree.XMLParser(recover=True, huge_tree=True)
             tree = etree.parse(infile, parser)

It reported one error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions