title: How to display a Protein Data Bank PDB in a Jupyter notebook?
body: <p>I am trying to follow this <a href="https://www.mdanalysis.org/2016/03/14/nglview/" rel="nofollow noreferrer">post</a>, but it fails to display a PDB inside a Jupyter notebook:</p>
  
  <pre><code>import MDAnalysis as mda
  import nglview as nv
  from nglview.datafiles import PDB, XTC
  
  u = mda.Universe(PDB, XTC)
  
  protein = u.select_atoms('protein')
  </code></pre>
  
  <p>When I try to do:</p>
  
  <pre><code>w = nv.show_mdanalysis(protein)
  w
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>---------------------------------------------------------------------------
  ModuleNotFoundError                       Traceback (most recent call last)
  &lt;ipython-input-2-499e28f0ffd3&gt; in &lt;module&gt;()
  ----&gt; 1 w = nv.show_mdanalysis(protein)
        2 w
  
  ~/anaconda3/lib/python3.6/site-packages/nglview-0.4-py3.5.egg/nglview/__init__.py in show_mdanalysis(atomgroup, **kwargs)
      118     '''
      119     structure_trajectory = MDAnalysisTrajectory(atomgroup)
  --&gt; 120     return NGLWidget(structure_trajectory, **kwargs)
      121 
      122 
  
  ~/anaconda3/lib/python3.6/site-packages/nglview-0.4-py3.5.egg/nglview/__init__.py in __init__(self, structure, trajectory, representations, parameters, **kwargs)
      347         if parameters:
      348             self.parameters = parameters
  --&gt; 349         self.set_structure(structure)
      350         if trajectory:
      351             self.trajectory = trajectory
  
  ~/anaconda3/lib/python3.6/site-packages/nglview-0.4-py3.5.egg/nglview/__init__.py in set_structure(self, structure)
      372     def set_structure(self, structure):
      373         self.structure = {
  --&gt; 374             "data": structure.get_structure_string(),
      375             "ext": structure.ext,
      376             "params": structure.params
  
  ~/anaconda3/lib/python3.6/site-packages/nglview-0.4-py3.5.egg/nglview/__init__.py in get_structure_string(self)
      313                 "'MDAnalysisTrajectory' requires the 'MDAnalysis' package"
      314             )
  --&gt; 315         import cStringIO
      316         u = self.atomgroup.universe
      317         u.trajectory[0]
  
  ModuleNotFoundError: No module named 'cStringIO'
  </code></pre>
  
  <hr>
  
  <p>Edit Feb. 2020: I believe this is not an issue anymore if the libraries you are using updated their code to python3 properly: <a href="https://stackoverflow.com/questions/28200366/python-3-x-importerror-no-module-named-cstringio">python 3.x ImportError: No module named &#39;cStringIO&#39;</a>, and it should be ok by now as python2 is deprecated. </p>