0

我无法安装 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 中指定的解决方法给出了“命令“python setup.py egg_info”失败,错误代码为 1”

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

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

操作系统:Windows 8.1 Pro Python:3.6.0

4

2 回答 2

0

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

于 2018-12-09T06:35:26.260 回答
-1

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

于 2017-03-03T14:36:55.823 回答