저는 Jupyter Notebook에서 Python 2.7 및 3.4를 설치했습니다. 나는이 선으로 가져 오기 전에 BeautifulSoup로 설치 :Python 3에서 BeautifulSoup 가져 오는 중 오류가 발생했습니다.
pip install beautifulsoup4
문제는 beautifulsoup4는 파이썬 3.4에서 작업하는 동안은 파이썬 2.7에 설치되어 있습니다. 나는 또한 파이썬 3에 설치 pip3 install beautifulsoup4
을 시도했지만 문제가 여전히 내가이 줄을 수행 할 때
오류 :
ImportError: cannot import name _htmlparser
사람이 알고 있나요 from bs4 import BeautifulSoup
을 다시 아래의 오류 beautifulsoup4가 파이썬 3에 설치되어 있어야하며, 파이썬 2에 설치 될 때까지이 문제를 해결할 수 있습니까?
[ImportError : 'HTMLAwareEntitySubstitution'을 가져올 수 없습니다.] (https://stackoverflow.com/questions/40856104/importerror-cannot-import-name-htmlawareentitysubstitution) – Mark
@Mark 사실 내 문제는 다릅니다. 그리고 "pip install --upgrade --force-reinstall beautifulsoup4"명령을 수행하면 내 문제가 악화되고이 오류가 발생합니다. AttributeError : type 'HTMLAwareEntitySubstitution'객체에 'preserve_whitespace_tags'속성이 없습니다. – user8034918
아니요, _htmlparser를 수정하면됩니다. 오류가 발생하여 다음 오류로 이동하십시오. – Mark