【问题标题】:ImportError: No module named bs4 [duplicate]ImportError:没有名为 bs4 的模块 [重复]
【发布时间】:2014-10-31 01:47:26
【问题描述】:

我在 OSX 中使用 pip 安装了 BeautifulSoup4,但我仍然收到此错误:

dyn-72-33-214-45:craiglist mona$ python t1.py 
Traceback (most recent call last):
  File "t1.py", line 1, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4

知道怎么解决吗?

dyn-72-33-214-45:craiglist mona$ pip install BeautifulSoup4
....
Successfully installed BeautifulSoup4
Cleaning up...

【问题讨论】:

    标签: python beautifulsoup


    【解决方案1】:

    我使用easy_install 安装了它,现在它可以工作了。但是首先你应该使用sudo su

    dyn-72-33-214-45:craiglist mona$ sudo su
    sh-3.2# easy_install beautifulsoup4
    

    【讨论】:

      猜你喜欢
      • 2012-07-31
      • 1970-01-01
      • 2017-06-18
      • 1970-01-01
      • 2017-01-07
      • 2017-02-19
      • 2018-05-30
      • 2021-11-07
      • 2017-10-14
      相关资源
      最近更新 更多