Linux Python 3.3.2.4安装失败
正在尝试使用python 3.3.2安装beautifulsoup4-4.1.3-Linux Python 3.3.2.4安装失败,linux,python-3.x,beautifulsoup,Linux,Python 3.x,Beautifulsoup,正在尝试使用python 3.3.2安装beautifulsoup4-4.1.3- $ sudo /usr/bin/Python-3.3.2/python ./setup.py install running install running build running build_py running install_lib byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/eleme
$ sudo /usr/bin/Python-3.3.2/python ./setup.py install
running install
running build
running build_py
running install_lib
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/element.py to element.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/element.py", line 1200
print 'Running CSS selector "%s"' % selector
^
SyntaxError: invalid syntax
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/tests/test_html5lib.py to test_html5lib.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/tests/test_html5lib.py", line 8
except ImportError, e:
^
SyntaxError: invalid syntax
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/tests/test_lxml.py to test_lxml.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/tests/test_lxml.py", line 11
except ImportError, e:
^
SyntaxError: invalid syntax
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/tests/test_soup.py to test_soup.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/tests/test_soup.py", line 28
except ImportError, e:
^
SyntaxError: invalid syntax
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/__init__.py to __init__.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/__init__.py", line 365
print soup.prettify()
^
SyntaxError: invalid syntax
byte-compiling /opt/python3/lib/python3.3/site-packages/bs4/builder/_htmlparser.py to _htmlparser.cpython-33.pyc
File "/opt/python3/lib/python3.3/site-packages/bs4/builder/_htmlparser.py", line 68
except (ValueError, OverflowError), e:
^
SyntaxError: invalid syntax
running install_egg_info
Removing /opt/python3/lib/python3.3/site-packages/beautifulsoup4-4.1.3-py3.3.egg-info
Writing /opt/python3/lib/python3.3/site-packages/beautifulsoup4-4.1.3-py3.3.egg-info
我在安装Python 3.3时没有遇到任何问题。在您的例子中,from distutils.command.build\u py import build\u py 2to3 as build\u py行似乎出了问题。在任何情况下,我都会使用pip或easy_install来安装这样的软件包。pip使用python2.6我似乎找不到如何使用pip来安装python3-非常感谢您的帮助!每个python安装都安装pip,并且通常还包括一个pip版本链接;试试pip-3.3。