下载PyCharm上的BeautifulSoup

时间:2016-05-12 17:13:17

标签: python beautifulsoup

我试图通过PyCharm安装BeautifulSoup包,我也尝试通过命令行下载它。但我似乎无法在PyCharm上运行它。我一直收到以下错误

Collecting BeautifulSoup
  Using cached BeautifulSoup-3.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\setup.py", line 22
        print "Unit tests have failed!"
                                      ^
    SyntaxError: Missing parentheses in call to 'print'

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

有人可以帮忙吗?

提前致谢

1 个答案:

答案 0 :(得分:1)

你习惯使用Python 2.7吗?它似乎要求您的print语句使用Python 3.X语法,因此它可能是您尝试使用的版本的问题?

BeautifulSoup 3.2.1仅适用于Python 2.7(并且已过时),如果你获得BeautifulSoup 4,它应该适用于这两个版本。