Python version and Device used
I\'m following the BeautifulSoup tu
FWIW, I ran into a similar problem (python 3.6, os x 10.12.6) and was able to solve it simply by doing (first command is just to signify that I was working in a conda virtualenv):
$ source activate ml-general
$ pip uninstall lxml
$ pip install lxml
I tried more complicated things first, because BeautifulSoup was working correctly with an identical command through Jupyter+iPython, but not through PyCharm's terminal in the same virtualenv. Simply reinstalling lxml as above solved the problem.