python - 安装包 Beautiful Soup 失败。错误消息是 "SyntaxError: Missing parentheses in call to ' print'"

标签 python python-3.x beautifulsoup

我已经在我的 Windows 8 计算机上安装了 Python 3.5。我还安装了 Pycharm 社区版本 5.0.4。我无法通过 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\Kashyap\AppData\Local\Temp\pycharm-packaging0.tmp\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\Kashyap\AppData\Local\Temp\pycharm-packaging0.tmp\BeautifulSoup

Python安装文件夹路径为3.5.1 (C:\Program Files (x86)\Python35-32\python.exe)

最佳答案

您正在尝试安装 BeautifulSoup 3,它与 Python 3 不兼容。正如 Pycharm 错误窗口所解释的那样:

Make sure you use a version of Python supported by this package. Currently you are using Python 3.5.

但是,您想安装 BeautifulSoup 4;该系列的项目名称已更改为 beautifulsoup4 . BeautifulSoup 4 已经推出几年了,它支持 Python 3。

关于python - 安装包 Beautiful Soup 失败。错误消息是 "SyntaxError: Missing parentheses in call to ' print'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35748239/

相关文章:

python - 正则表达式有两个可选组,但不仅仅是第一组

python - 当我运行脚本时,为什么 Spyder 要保存我的 *.py 文件?

python - Matplotlib/Genfromtxt : Multiple plots against time, 跳过 .csv 中缺失的数据点

python - 如何禁用 Tkinter 列表框中的水平滚动? (Python 3)

python - 如何使用 python beautiful soup 从下面的 HTML 中获取标签和 ID 信息

Python: "if i.find(' a') ['id' ] is not None :"returns TypeError ' NoneType' 对象不可下标,但 print() 返回一个值

python - 从损坏的 html 标签中提取文本,并使用 <br> 分隔元素

python - 如何使用 Tensorflow 执行笛卡尔积?

python - 无法导入使用 PIP 安装的包

python - 按元组值日期对象对字典进行排序