python-3.x - 我无法在 python3 中导入 beautifulsoup
问题描述
当我pip install BeautifulSoup4
在命令行中运行时,它会显示这样的输出
已满足要求:/usr/lib/python2.7/dist-packages (4.5.1) 中的 BeautifulSoup4
美汤装在python2.7
不在python 3.5
我什至复制和bs4
文件BeautifulSoup4
夹从仍然导入显示错误是python 2.7/dist-packages
python3.5/distutils/
BeautifulSoup4
No module named 'Beautiful Soup' found
在运行Beutifulsoup4
时python2.7
,我没有得到相关的输出,因为我在解析 HTML 网页时得到了例外。
请帮助我如何安装bs4
。python3.5
解决方案
使用以下命令安装 BeautifulSoup4:
pip3 install BeautifulSoup4
如果它不起作用,请尝试,
python3 -m pip install BeautifulSoup4
在最坏的情况下,以上都不起作用,请尝试以下命令
apt-get install python3-bs4
或者,对于非 root 用户。
sudo apt-get install python3-bs4
推荐阅读
- android - 为什么 AppBarLayout 底部内容被截断?
- c# - 错误!join 子句中的表达式之一的类型不正确。调用“GroupJoin”时类型推断失败
- arrays - 在 C 语言中使用数组声明类似的函数
- python - 如何使用 youtubedl 的搜索功能而不是 url 让我的不和谐机器人播放音乐?(Python)
- heroku - 验证器问题,验证码正确
- python - 是否可以在 matplotlib 中用填充图案装饰 3D 条?
- android - 具有电容器 callbackId 的离子原生媒体:INVALID
- php - 如何在 PHP(浏览器)中重现地表示非 UTF8 字符串
- javascript - 根据选择显示 div
- reactjs - 是否可以根据 react-router-dom 中同一 url 中的 url 参数值呈现不同的组件?