V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yakczh
V2EX  ›  Python

python3 安装 BeautifulSoup 提示 Unit tests have failed!

  •  
  •   yakczh · 2014-06-08 12:40:36 +08:00 · 7617 次点击
    这是一个创建于 3848 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Downloading/unpacking BeautifulSoup
    Downloading BeautifulSoup-3.2.1.tar.gz
    Running setup.py egg_info for package BeautifulSoup
    Traceback (most recent call last):
    File "<string>", line 16, in <module>
    File "d:\tmp\BeautifulSoup\setup.py", line 22
    print "Unit tests have failed!"
    ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

    File "<string>", line 16, in <module>

    File "d:\tmp\BeautifulSoup\setup.py", line 22

    print "Unit tests have failed!"

    ^

    SyntaxError: invalid syntax

    ----------------------------------------
    Cleaning up...
    Command python setup.py egg_info failed with error code 1 in d:\tmp\BeautifulSoup
    3 条回复    2014-06-08 14:03:14 +08:00
    cbsw
        1
    cbsw  
       2014-06-08 13:00:35 +08:00
    你确定这个库已经支持 python3 了吗? Unit test 明显是 py2 的语法 print "something",而不是 print("something")
    lizheming
        2
    lizheming  
       2014-06-08 13:06:31 +08:00
    pip3 install beautifulsoup4

    BeautifulSoup是bs3,只支持python2.x的 http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html
    Crossin
        3
    Crossin  
       2014-06-08 14:03:14 +08:00
    装bs4
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2729 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 03:50 · PVG 11:50 · LAX 19:50 · JFK 22:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.