beautifulsoup erkennt lxml nicht
Ich versuche es zu benutzenlxml
als Parser für BeautifulSoup, weil der Standard viel langsamer ist, aber ich erhalte diesen Fehler:
soup = BeautifulSoup(html, "lxml")
File "/home/rob/python/stock/local/lib/python2.7/site-packages/bs4/__init__.py", line 152, in __init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
Ich habe lxml und beautifulsoup viele Male deinstalliert und neu installiert, aber es wird es immer noch nicht lesen. Ich habe auch versucht, lxml-Abhängigkeiten neu zu installieren, und das bekomme ich immer noch.
Ich habe sogar eine neue virtuelle Umgebung erstellt und alles neu installiert und bekomme trotzdem diesen Fehler.
Hat jemand eine Idee, was hier los ist?
Bearbeitungen
Verwenden der neuesten Versionen von bs4 und lxml unter Python 2.7.x auf dem Ubuntu-Desktop
ich kannimport lxml
aber ich kann nichtfrom lxml import etree
das kehrt zurück:
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libxml2.so.2: version `LIBXML2_2.9.0' not found (required by /home/rob/python/stock/local/lib/python2.7/site-packages/lxml/etree.so)
Ich habe libxml, aber ich bin nicht sicher, welche Version ich habe, aber ich habe die neueste installiert und neu installiert. habe auch versucht 2.9.0 manuell zu installieren und noch nix