Jupyter Notebook BeautifulSoup ImportError
<p>I am new to python dev and have recently installed a fresh, 64-bit version of anaconda (with python v. 2.7.12) yesterday (<a href="https://www.continuum.io/downloads#windows" rel="nofollow">https://www.continuum.io/downloads#windows</a>) on my windows 8 machine. I immediately launched the Jupyter Notebook instance that came with anaconda and expected that I be able to use BeautifulSoup. Upon executing this line in my notebook.ipynb file: <code>from bs4 import BeautifulSoup</code> I received an <code>ImportError</code>: </p>

<pre><code>ImportError                               Traceback (most recent call last)
&lt;ipython-input-12-cbb98e44f096&gt; in &lt;module&gt;()
      9 #from yelp.oauth1_authenticator import Oauth1Authenticator
     10 
---&gt; 11 from bs4 import BeautifulSoup

C:\Users\xxx\Anaconda2\lib\site-packages\bs4\__init__.py in &lt;module&gt;()
     33 import warnings
     34 
---&gt; 35 from .builder import builder_registry, ParserRejectedMarkup
     36 from .dammit import UnicodeDammit
     37 from .element import (

C:\Users\xxx\Anaconda2\lib\site-packages\bs4\builder\__init__.py in &lt;module&gt;()
    313 # to take precedence over html5lib, because it's faster. And we only
    314 # want to use HTMLParser as a last result.
--&gt; 315 from . import _htmlparser
    316 register_treebuilders_from(_htmlparser)
    317 try:

C:\Users\xxx\Anaconda2\lib\site-packages\bs4\builder\_htmlparser.py in &lt;module&gt;()
      8     ]
      9 
---&gt; 10 from HTMLParser import HTMLParser
     11 
     12 try:

ImportError: cannot import name HTMLParser
</code></pre>

<p>What I've tried:</p>

<ul>
<li>pip install HTMLParser</li>
<li>pip install bs4</li>
<li>Uninstalling and installing beautifulsoup4 and beautifulsoup packages available in the anaconda navigator. </li>
<li>conda install HTMLParser --> resulted in package not found on anaconda repos error</li>
<li>conda install bs4 --> resulted in package not found on anaconda repos error</li>
</ul>

<p>I have been trying to get this set up working without virtual environments in the notebook. I thought it would be possible to get it working with the root env.</p>

<p>Any help with this issue would be much appreciated!</p>

<p>I just restarted my PC and Jupyter Notebook detected the HTMLParser module. Not sure what I did to actually fix it - but I'm guessing the answer is one of the following steps I listed in my original question then restarting and launching Jupyter again. </p>

python beautifulsoup anaconda