【问题标题】:Unable to Install beautifulsoup on Windows 8.1无法在 Windows 8.1 上安装 beautifulsoup
【发布时间】:2018-12-09 14:35:26
【问题描述】:

我无法安装 beautifulsoup 模块

错误:

C:\WINDOWS\system32>pip install beautifulsoup
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\surabhis\AppData\Local\Temp\pip-build-tdxcdfig\beautifulsou
p\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\username
\AppData\Local\Temp\pip-build-tdxcdfig\beautifulsoup\

我遵循了在 Python pip install gives "Command "python setup.py egg_info" failed with error code 1"

pip install --upgrade setuptools pip install ez_setup 然后重试模块安装。

但是,它仍然无法正常工作。我以管理员身份使用 cmd。

操作系统:Windows 8.1 Pro Python:3.6.0

【问题讨论】:

标签: python windows-8.1 python-3.6


【解决方案1】:

我不知道您使用的是什么版本,但我只是使用了您提供的语法,因为我无法通过 Windows 8.1 安装,但使用了“beautifulsoup4”(不是“beautifulsoup”)并且它有效!

【讨论】:

    【解决方案2】:

    我是新手。由于没有回应,我想我会回应这个。在 Windows 7 下,我发现 python print 命令在 print 参数周围没有括号时不起作用。因此,您可以更改脚本,使其打印命令具有这些括号。

    【讨论】:

    • 实际上,print 是 python 3 中的一个函数。您不会看到直接在跨操作系统的规范更改中指定的语言实现细节——这样做将是解释器中的一个错误,并且应该非常罕见。见source
    猜你喜欢
    • 2014-12-14
    • 1970-01-01
    • 1970-01-01
    • 2015-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2015-07-23
    相关资源
    最近更新 更多