我已经在我的 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/