无法在Termux中导入beautifulsoup4模块

时间:2019-11-15 03:41:27

标签: python termux

以下是完整的日志,显示我无法导入beautifulsoup4

$ python
Python 3.7.5 (default, Oct 23 2019, 08:30:10)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6 on linux
Type "help", "copyright", "credits" or "license" for more information.

import bs4
from bs4 import beautifulsoup4

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'beautifulsoup4' from 'bs4' (/data/data/com.termux/files/usr/lib/python3.7/site-packages/bs4/__init__.py)

import beautifulsoup4

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'beautifulsoup4'

1 个答案:

答案 0 :(得分:1)

这对我有用:

>>> from bs4 import BeautifulSoup
>>>