You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MechanicalSoup is a really nice package i have used for, but it still requires C Compiler to compile the lxml on *nix systems.
It may be a problem to port to some platforms without C Compiler, such as Android or some minified Linux.
Currently i used a script to build MechanicalSoup without lxml:
#!/bin/sh# Remove lxml in requirements.txt
sed -i '/lxml/d' requirements.txt
# Use `html.parser` instead `lxml`
sed -i "s@{'features': 'lxml'}@{'features': 'html.parser'}@g" mechanicalsoup/*.py
# Fix examples and tests
sed -i "s@\\(BeautifulSoup(.\\{1,\\}\\)'lxml'\\(.*)\\)@\1'html.parser'\2@g" examples/*.py tests/*.py
It works well, so i think it is not a big problem...
The text was updated successfully, but these errors were encountered:
lxml became the default in 83b2cdd, see the commit message for a bit more info. Essentially, the problem is:
We really want a default value for the parser, because we want reproducibility (not having a default would mean that the same program using MechanicalSoup would behave differently depending on what is installed on the machine where it runs).
lxml is rather clearly the best default in terms of features and performance, so although it adds a dependency we chose it as default. And therefore it has to be a dependency, otherwise the default configuration would be broken.
I believe the simplest option for people who need to run MechanicalSoup on machines where a C compiler isn't installed is to patch it, as you did. We could also try to publish a MechanicalSoup-lite, or so, variant where lxml would not be a dependency but that would probably be a lot of trouble for a very small number of users. Up to now, I think we never got this request (except your message obviously).
MechanicalSoup is a really nice package i have used for, but it still requires C Compiler to compile the lxml on *nix systems.
It may be a problem to port to some platforms without C Compiler, such as Android or some minified Linux.
Currently i used a script to build MechanicalSoup without lxml:
It works well, so i think it is not a big problem...
The text was updated successfully, but these errors were encountered: