问题
I am currently trying to use BeautifulSoup for a Web App and I have installed the beautifulsoup4 egg in a local dir with easy_install --install-dir=PATH_TO_DIR beautifulsoup4, but when I run my app I'm getting the current error that I don't know what to do about:
Traceback (most recent call last):
from bs4 import BeautifulSoup
File "/home/ryanefoley/py_libs/beautifulsoup4-4.3.2-py2.6.egg/bs4/__init__.py", line 186
if ((isinstance(markup, bytes) and not b' ' in markup)
^
SyntaxError: invalid syntax
I would greatly appreciate any help!
Note, I am importing the module in my python script with:
egg_path='/home/ryanefoley/py_libs/beautifulsoup4-4.3.2-py2.6.egg'
sys.path.append(egg_path)
from bs4 import BeautifulSoup
来源:https://stackoverflow.com/questions/19718015/importing-and-using-beautifulsoup-for-web-app