py4vasp issue
Posted: Thu Jan 12, 2023 2:27 pm
hello dear
I am trying to Vizualize the structure at each step using py4vasp! in jupyter lab as per guideline link "tutorials/latest/molecules/part2/" under section 5.3. but i am facing problem to run following instruction.
Command apply in jupyter console
=============================
import py4vasp
my_calc = py4vasp.Calculation.from_path("./e05_CO-bond")
my_calc.structure[:].plot()
Error
=================================
AttributeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import py4vasp
2 my_calc = py4vasp.Calculation.from_path("./e05_CO-bond")
4 my_calc.structure[:].plot()
File ~/.local/lib/python3.8/site-packages/py4vasp/__init__.py:3
1 # Copyright © VASP Software GmbH,
2 # Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
----> 3 from .calculation import Calculation
4 from py4vasp._third_party.interactive import set_error_handling
6 __version__ = "0.4.0"
File ~/.local/lib/python3.8/site-packages/py4vasp/calculation.py:16
3 """Provide the tools to manage VASP calculations.
4
5 This is the main user interface if you want to simply investigate the results of VASP
(...)
13 >>> calc.structure.print() # to print the structure in a POSCAR format
14 """
15 import inspect
---> 16 import py4vasp.data
17 import py4vasp.exceptions as exception
18 import py4vasp.control
File ~/.local/lib/python3.8/site-packages/py4vasp/data/__init__.py:33
31 from .projector import Projector
32 from .topology import Topology
---> 33 from .viewer3d import Viewer3d
34 from .structure import Structure
35 from .system import System
File ~/.local/lib/python3.8/site-packages/py4vasp/data/viewer3d.py:6
4 import py4vasp.exceptions as exception
5 import collections
----> 6 import nglview
7 import mrcfile
8 import numpy as np
File ~/.local/lib/python3.8/site-packages/nglview/__init__.py:4
1 import warnings
3 # for doc
----> 4 from . import adaptor, datafiles, show, widget
5 from ._version import get_versions
6 from .adaptor import *
File ~/.local/lib/python3.8/site-packages/nglview/show.py:13
3 from . import datafiles
4 from .adaptor import (ASEStructure, ASETrajectory, BiopythonStructure,
5 FileStructure, HTMDTrajectory, IODataStructure,
6 IOTBXStructure, MDAnalysisTrajectory, MDTrajTrajectory,
(...)
11 RdkitStructure,
12 TextStructure)
---> 13 from .widget import NGLWidget
15 __all__ = [
16 'demo',
17 'show_pdbid',
(...)
40 'show_biopython',
41 ]
44 def show_pdbid(pdbid, **kwargs):
File ~/.local/lib/python3.8/site-packages/nglview/widget.py:19
15 from traitlets import (Bool, CaselessStrEnum, Dict, Instance, Int, Integer,
16 List, Unicode, observe, validate)
17 import traitlets
---> 19 from . import color, interpolate
20 from .adaptor import Structure, Trajectory
21 from .component import ComponentViewer
File ~/.local/lib/python3.8/site-packages/nglview/color.py:114
110 else:
111 raise ValueError(f"{obj} must be either list of list or string")
--> 114 ColormakerRegistry = _ColormakerRegistry()
File ~/.local/lib/python3.8/site-packages/nglview/base.py:10, in _singleton.<locals>.getinstance()
8 def getinstance():
9 if cls not in instances:
---> 10 instances[cls] = cls()
11 return instances[cls]
File ~/.local/lib/python3.8/site-packages/nglview/color.py:47, in _ColormakerRegistry.__init__(self, *args, **kwargs)
45 try:
46 get_ipython() # only display in notebook
---> 47 self._ipython_display_()
48 except NameError:
49 pass
File ~/.local/lib/python3.8/site-packages/nglview/color.py:54, in _ColormakerRegistry._ipython_display_(self, **kwargs)
52 if self._ready:
53 return
---> 54 super()._ipython_display_(**kwargs)
AttributeError: 'super' object has no attribute '_ipython_display_'
I am trying to Vizualize the structure at each step using py4vasp! in jupyter lab as per guideline link "tutorials/latest/molecules/part2/" under section 5.3. but i am facing problem to run following instruction.
Command apply in jupyter console
=============================
import py4vasp
my_calc = py4vasp.Calculation.from_path("./e05_CO-bond")
my_calc.structure[:].plot()
Error
=================================
AttributeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import py4vasp
2 my_calc = py4vasp.Calculation.from_path("./e05_CO-bond")
4 my_calc.structure[:].plot()
File ~/.local/lib/python3.8/site-packages/py4vasp/__init__.py:3
1 # Copyright © VASP Software GmbH,
2 # Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
----> 3 from .calculation import Calculation
4 from py4vasp._third_party.interactive import set_error_handling
6 __version__ = "0.4.0"
File ~/.local/lib/python3.8/site-packages/py4vasp/calculation.py:16
3 """Provide the tools to manage VASP calculations.
4
5 This is the main user interface if you want to simply investigate the results of VASP
(...)
13 >>> calc.structure.print() # to print the structure in a POSCAR format
14 """
15 import inspect
---> 16 import py4vasp.data
17 import py4vasp.exceptions as exception
18 import py4vasp.control
File ~/.local/lib/python3.8/site-packages/py4vasp/data/__init__.py:33
31 from .projector import Projector
32 from .topology import Topology
---> 33 from .viewer3d import Viewer3d
34 from .structure import Structure
35 from .system import System
File ~/.local/lib/python3.8/site-packages/py4vasp/data/viewer3d.py:6
4 import py4vasp.exceptions as exception
5 import collections
----> 6 import nglview
7 import mrcfile
8 import numpy as np
File ~/.local/lib/python3.8/site-packages/nglview/__init__.py:4
1 import warnings
3 # for doc
----> 4 from . import adaptor, datafiles, show, widget
5 from ._version import get_versions
6 from .adaptor import *
File ~/.local/lib/python3.8/site-packages/nglview/show.py:13
3 from . import datafiles
4 from .adaptor import (ASEStructure, ASETrajectory, BiopythonStructure,
5 FileStructure, HTMDTrajectory, IODataStructure,
6 IOTBXStructure, MDAnalysisTrajectory, MDTrajTrajectory,
(...)
11 RdkitStructure,
12 TextStructure)
---> 13 from .widget import NGLWidget
15 __all__ = [
16 'demo',
17 'show_pdbid',
(...)
40 'show_biopython',
41 ]
44 def show_pdbid(pdbid, **kwargs):
File ~/.local/lib/python3.8/site-packages/nglview/widget.py:19
15 from traitlets import (Bool, CaselessStrEnum, Dict, Instance, Int, Integer,
16 List, Unicode, observe, validate)
17 import traitlets
---> 19 from . import color, interpolate
20 from .adaptor import Structure, Trajectory
21 from .component import ComponentViewer
File ~/.local/lib/python3.8/site-packages/nglview/color.py:114
110 else:
111 raise ValueError(f"{obj} must be either list of list or string")
--> 114 ColormakerRegistry = _ColormakerRegistry()
File ~/.local/lib/python3.8/site-packages/nglview/base.py:10, in _singleton.<locals>.getinstance()
8 def getinstance():
9 if cls not in instances:
---> 10 instances[cls] = cls()
11 return instances[cls]
File ~/.local/lib/python3.8/site-packages/nglview/color.py:47, in _ColormakerRegistry.__init__(self, *args, **kwargs)
45 try:
46 get_ipython() # only display in notebook
---> 47 self._ipython_display_()
48 except NameError:
49 pass
File ~/.local/lib/python3.8/site-packages/nglview/color.py:54, in _ColormakerRegistry._ipython_display_(self, **kwargs)
52 if self._ready:
53 return
---> 54 super()._ipython_display_(**kwargs)
AttributeError: 'super' object has no attribute '_ipython_display_'