没有名为'bs4'的模块

时间:2017-12-21 03:29:55

标签: python

我想导入BeautifulSoup。但有一个问题。 BeautifulSoup库安装在anaconda中。

C:\Users\q>pip install BeautifulSoup4
Requirement already satisfied: BeautifulSoup4 in c:\users\q\anaconda3\lib\site-packages

但是当我想导入BeautifulSoup时,它会触发错误。

from bs4 import BeautifulSoup

这是结果

Traceback (most recent call last):  

File "C:\Users\q\pyfile\ipsearch.py", line 1, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'

为什么呢?原因是python的网站包的路径和anaconda的网站包的路径触发了一个混乱?一个月前,我成功使用它,那时,我的电脑安装了python3.5和anaconda。但现在,它会触发错误。为什么?谢谢你的回答。

1 个答案:

答案 0 :(得分:1)

尝试以下命令:

pip install --ignore-installed beautifulsoup4
相关问题