2

I am following a Python course with 'Harrison Python Web Programming', and have got stuck on the 'Scraping RSS feeds (3.4.2)' section.

When I install BeautifulSoup4, it seems to install fine, but then when I execute the code I run into this error:

Traceback (most recent call last): File "C:/Users/Owen/Desktop/Owen/Electronics/Code/Python Web Programming XML.py", line 6, in <module> xml= BeautifulSoup(req, 'xml') File "C:\Users\Owen\AppData\Local\Programs\Python\Python35-32\lib\site-packages\bs4\__init__.py", line 165, in __init__ % ",".join(features)) bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

I have had a look around on the net, and have been told that I need to install lxml. But when I do that I run into this error:

error: Unable to find vcvarsall.bat

Can anyone help?

MrMule
  • 153
  • 1
  • 5
  • 1
    https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/ –  Nov 04 '16 at 12:20
  • `lxml` and `beautifulsoup4` both have wheels, still getting the same error. What are you suggesting? – MrMule Nov 04 '16 at 13:23
  • lxml has an "unofficial" wheel, are you using that? Check the MS Windows section on: http://lxml.de/installation.html –  Nov 04 '16 at 13:34
  • Perfect! Thank you jinks, anyone know why the official don't work? – MrMule Nov 04 '16 at 14:34

1 Answers1

0

You are probably seeing the "Error: Unable to find vcvarsall.bat" because pip assumes you have a MS Visual C++ compiler installed. (If I'm not mistaken, pip also assumes that you magically have the correct version of the compiler as well.)

Futher reading

Using a precompiled wheel will often work. However, per lxml:

If you fail to build lxml on your MS Windows system from the signed and tested sources that we release, consider using the binary builds from PyPI or the unofficial Windows binaries that Christoph Gohlke generously provides.

Community
  • 1
  • 1