0

I´ve already installed beautifulsoup4 but it doesn´t work.

This is the second time I try to install:

(k36) C:\GROWTHTECH\Projetos\blockchain>python -m pip install beautifulsoup4
Requirement already satisfied: beautifulsoup4 in c:\users\patff\appdata\local\conda\conda\envs\k36\lib\site-packages\beautifulsoup4-4.6.0-py3.6.egg
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

When I made a test:

>>> import beautifulsoup4
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'beautifulsoup4'
>>> from BeautifulSoup import BeautifulSoup
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'BeautifulSoup'
>>> exit()
cezar
  • 11,616
  • 6
  • 48
  • 84
Patricia
  • 79
  • 1
  • 11

1 Answers1

0

The official import name of BeautifulSoup was changed to bs4 in version 4 [1] [2]. If it is installed correctly otherwise, import the package by calling:

import bs4
Joseph Farah
  • 2,463
  • 2
  • 25
  • 36
  • yes, but it didn´t work also. >>> import bs4 File "C:\Users\patff\AppData\Local\conda\conda\envs\k36\lib\site-packages\beautifulsoup4-4.6.0-py3.6.egg\bs4\__init__.py", line 53 'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).' – Patricia Apr 24 '18 at 13:10
  • @Patricia on the plus side though, it looks like it gave you the solution to your problem! – Joseph Farah Apr 24 '18 at 13:11