Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute error while trying to import prolintpy #8

Open
anjukris opened this issue Sep 30, 2022 · 1 comment
Open

Attribute error while trying to import prolintpy #8

anjukris opened this issue Sep 30, 2022 · 1 comment

Comments

@anjukris
Copy link

I have installed prolintpy using the third method outlined in the documentation. I ran into an import error while trying to import prolintpy, as detailed in the previous issue (#6 ) that has been kept open by you. I thought the problem would be resolved after following the solution outlined in the thread but now I'm getting this

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_8570/3457557373.py in <module>
      1 import mdtraj as md
----> 2 import prolintpy as pl

~/anaconda3/envs/prolint/lib/python3.7/site-packages/prolintpy/__init__.py in <module>
      5 from .vis.show_points import show_points
      6 from .vis.show_network import show_network
----> 7 from .vis.show_contact_projection import show_contact_projection
      8 from .vis.show_distances import show_distances
      9 from .vis.show_radar import show_radar

~/anaconda3/envs/prolint/lib/python3.7/site-packages/prolintpy/vis/show_contact_projection.py in <module>
      4 from matplotlib.pyplot import cm
      5 
----> 6 import nglview as nv
      7 
      8 from prolintpy.utils.shift_range import shift_range

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/__init__.py in <module>
      2 
      3 # for doc
----> 4 from . import adaptor, datafiles, show, widget
      5 from ._version import get_versions
      6 from .adaptor import *

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/show.py in <module>
     11                       RdkitStructure,
     12                       TextStructure)
---> 13 from .widget import NGLWidget
     14 
     15 __all__ = [

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/widget.py in <module>
     17 import traitlets
     18 
---> 19 from . import color, interpolate
     20 from .adaptor import Structure, Trajectory
     21 from .component import ComponentViewer

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in <module>
    112 
    113 
--> 114 ColormakerRegistry = _ColormakerRegistry()

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/base.py in getinstance()
      8     def getinstance():
      9         if cls not in instances:
---> 10             instances[cls] = cls()
     11         return instances[cls]
     12     return getinstance

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in __init__(self, *args, **kwargs)
     45         try:
     46             get_ipython() # only display in notebook
---> 47             self._ipython_display_()
     48         except NameError:
     49             pass

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in _ipython_display_(self, **kwargs)
     52         if self._ready:
     53             return
---> 54         super()._ipython_display_(**kwargs)
     55 
     56     def __repr__(self):

AttributeError: 'super' object has no attribute '_ipython_display_'

I don't why this is happening. I am also very new to Jupyter. Help would be great!

@anjukris
Copy link
Author

Hello, I managed to resolve this by forcing conda to downgrade ipythonwidget version 8 to 7

conda install -c conda-forge "ipywidgets <8" (in my prolint environment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant