ImportError: cannot import name 'beautifulsoup'

 

# Test that python use 3.7
C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe
 
# Test that pip use 3.7
C:\>pip -V
pip 10.0.1 from c:\python37\lib\site-packages\pip (python 3.7)
 
# Install
C:\>pip install -U beautifulsoup4
Requirement already up-to-date: beautifulsoup4 in c:\python37\lib\site-packages (4.6.0)
 
# Test that it work
C:\>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import bs4
>>> bs4.__version__
'4.6.0'
 
>>> # Normal import
>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup('html', 'html.parser') # Or 'lxml' for faster parser

Post a Comment

0 Comments