Installed BeautifulSoup4 in both Python 2.7 and 3.6, but ModuleNotFoundError: No module named 'bs4'

Viewed 1630

I've successfully installed BeautifulSoup4 in 2.7 and 3.6 in the terminal, but when I use either Spyder or Jupyter Notebook, I get the following error when trying to import bs4 when using the Python 3.6 kernel

from bs4 import BeautifulSoup

ModuleNotFoundError: No module named 'bs4'

I've tried the following Terminal commands:

  • sudo apt-get install python3-bs4
  • python3.6 -m pip install bs4
  • py3.6 -m pip install bs4
  • sudo pip3 install BeautifulSoup4
  • python3.6 /Users/MY-NAME/anaconda/bin/pip install bs4

NB: I have created separate kernels for the two versions of python:

  • py27
  • py3.6

Any other solutions that I haven't tried or anything that I've obviously missed/misunderstood?

Thanks in advance for your help!

1 Answers
Related