ImportError: No module named bs4

714 views
Skip to first unread message

Jason Rudin

unread,
Jul 4, 2017, 4:04:57 PM7/4/17
to beautifulsoup
I'm sure this isn't the first time this error has come up, but I've been looking through the forums and things still aren't working. Here's what I'm doing:


 ~ $ pip install beautifulsoup4

Collecting beautifulsoup4

  Using cached beautifulsoup4-4.6.0-py2-none-any.whl

Installing collected packages: beautifulsoup4

Successfully installed beautifulsoup4-4.6.0


~ $ python

Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39) 

[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys, os, getopt, traceback, codecs, re

>>> from bs4 import BeautifulSoup

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ImportError: No module named bs4


the module is getting successfully installed, because when I run pip freeze, one of the outputs is:


beautifulsoup4==4.6.0


I'd really appreciate your help, thanks!



Micke Wu

unread,
Jul 4, 2017, 5:21:40 PM7/4/17
to beautifulsoup
This should work!

>>> import bs4
>>> from bs4 import BeautifulSoup

Ian Cheng

unread,
Mar 26, 2018, 7:41:11 AM3/26/18
to beautifulsoup
Jason, I got the same problem. Did you solve the problem yet? I have spent a day on settling this issue, but it didn't work. Can you tell me your solution?

Brian Haney

unread,
Mar 31, 2018, 5:50:23 PM3/31/18
to beautifulsoup
I got the same problem. Unfortunately Mickie's solution didn't work for me.
Reply all
Reply to author
Forward
0 new messages