Forums

ImportError: No module named 'beautifulsoup4'

My code uses several modules that are already included in Python 2.7. However, I can't seem to import any of them. Even a single line of

import beautifulsoup4

gives me the error in the title. So I opened a Bash console and tried to do the same thing and got this: MichaelFisher: unable to open X server `' @ error/import.c/ImportImageCommand/368. What does this mean, and how can I fix this?

Isn't the newer versions of beautifulsoup4 called bs4 now?

I get the same error message whether I import BeautifulSoup, beautifulsoup4, or bs4 in the console.

Yep. Personally I use:

from bs4 import BeautifulSoup