• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    미해결

html5lib 과 lxml 에서 모두 에러가 발생하고 있습니다.

21.01.10 20:55 작성 조회수 300

1

안녕하세요.

강의를 들으면서 따라하고 있습니다.

Colab에서는 잘 수행되었는데, WIndows PC에서 수행하려고 하니 잘 안되고 있습니다.

!pip install html5lib

!pip install lxml

#########

from bs4 import BeautifulSoup

example1 = BeautifulSoup(train['review'][0], "lxml")

example1 = BeautifulSoup(train['review'][0], "html5lib")

#########

오류 메시지는

---------------------------------------------------------------------------
FeatureNotFound                           Traceback (most recent call last)
<ipython-input-54-8cdcac2fe5bc> in <module>
      3 # import lxml.html as l
      4 
----> 5 example1 = BeautifulSoup(train['review'][0], "html5lib")

c:\program files\python38\lib\site-packages\bs4\__init__.py in __init__(self, markup, features, builder, parse_only, from_encoding, exclude_encodings, element_classes, **kwargs)
    240             builder_class = builder_registry.lookup(*features)
    241             if builder_class is None:
--> 242                 raise FeatureNotFound(
    243                     "Couldn't find a tree builder with the features you "
    244                     "requested: %s. Do you need to install a parser library?"

FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?

----------------------------------

어떻게 해야 할까요?
PC에서는 더 이상 진행이 되질 않습니다. ㅠ.ㅠ

답변 1

답변을 작성해보세요.

0

안녕하세요.

colab에서 잘 되는데 로컬에서 안 된다면 설치된 버전끼리의 의존성 문제일것 같습니다.

또,  의존 라이브러리를 설치했음에도 해당 오류가 발생한다니 어려움이 많으셨을것 같습니다.

이렇게 여러 라이브러리를 설치해서 사용하다보면 이런 오류에 대한 해결책을 찾기 쉽지 않은데요.

beatutifulsoup을 재설치 해보시는게 어떠실까 해요.

잘 해결되길 바라겠습니다.