Hello,
Today, I tried to reinstall py4vasp which I have been using for quite a long time. It worked well before but this time, after the installation, when I tried to import the module, I got the following error and I can't locate the source of the problem.
AttributeError                            Traceback (most recent call last)
/Users/xiliang/Downloads/vasp/code/validation.ipynb Cell 3 in <cell line: 1>()
----> 1 from py4vasp import Calculation
File /opt/anaconda3/envs/py4vasp/lib/python3.10/site-packages/py4vasp/__init__.py:3, in <module>
      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 /opt/anaconda3/envs/py4vasp/lib/python3.10/site-packages/py4vasp/calculation.py:16, in <module>
      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 /opt/anaconda3/envs/py4vasp/lib/python3.10/site-packages/py4vasp/data/__init__.py:33, in <module>
...
     52 if self._ready:
     53     return
---> 54 super()._ipython_display_(**kwargs)
AttributeError: 'super' object has no attribute '_ipython_display_'
I create a separate conda environment as has been suggested by you. It does not seem to be a problem with my way to install py4vasp. The problem occurs when I tried to use the import command in Visual Studio code, while everything goes well when I tried to import py4vasp from the terminal. 
Can you please kindly help with this? Thanks a lot in advance.
Best,
Xiliang
			
			
									
									
						problems with py4vasp
Moderators: Moderator, Global Moderator
- 
				xiliang_lian
 - Newbie

 - Posts: 37
 - Joined: Thu May 19, 2022 8:44 am
 
Re: problems with py4vasp
Hello,
For whoever comes to this problem in the future, I have found out the issue. It is actually a problem with nglview, which py4vasp depends on. The newest version of nglview has this problem, therefore leading to the failure of py4vasp I reported in my last post. The solution is to downgrade nglview to version 7. You may refer to this link (https://github.com/nglviewer/nglview/issues/1032)
Best
			
			
									
									
						For whoever comes to this problem in the future, I have found out the issue. It is actually a problem with nglview, which py4vasp depends on. The newest version of nglview has this problem, therefore leading to the failure of py4vasp I reported in my last post. The solution is to downgrade nglview to version 7. You may refer to this link (https://github.com/nglviewer/nglview/issues/1032)
Best
- 
				andreas.singraber
 - Global Moderator

 - Posts: 336
 - Joined: Mon Apr 26, 2021 7:40 am
 
Re: problems with py4vasp
Hello!
Thank you very much for sharing the solution you found for this problem
!
Best regards,
Andreas Singraber
			
			
									
									
						Thank you very much for sharing the solution you found for this problem
Best regards,
Andreas Singraber