Python Forum

Full Version: Where lxml for Python 3.6.2 for windows 10 ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
New to Python and have it installed on Windows 10 along with Beautiful Soup.

Tried to run tutorial code from...

import bs4 as bs
import urllib.request
source = urllib.request.urlopen('').read()
soup = bs.BeautifulSoup(source,'lxml')

1 - lxml package: But I get errors and think maybe (to start) I need to install the parser package lxml

2 - Python 3.6 lxml installer: But the lxml downloads for Python 3.6 from here are Python Wheel format and I am unsure how to recover Wheel format... is there no .exe installer?

3 - Any other reason the above code won't run with Python 3.6, Beautiful Soup, and lxml ?

Thanks for any help.
you need to install both BeautifulSoup and lxml via pip

you can use
c:\>pip install beautifulsoup4 c:\>pip install lxml
you can get wheel from or
then you should use pip to install from wheels. in this case instead of lxml you will use the wheel file name

pip install lxml-3.8.0-cp36-cp36m-win32.whl
I have couple of tutorials you can look at.
Python 3.6 and pip installation under Windows
Web-Scraping part-1

For 3.6 and pip(9) this work.
pip install beautifulsoup4 requests lxml
Before had to use wheel from Gohlke as posted bye @buran,
but now all work from pip(find wheel automatic an install).
I was sure there is tutorial about pip, but was not able to find it Blush
Is PIP included with Python or is that a seperate download and install?

pip should be installed with python and resides in the Scripts directory
There are individual versions for each python which can sometimes lead to problems
to make sure your using the one you think you are, you can verify with 'pip -V'
OK... do I enter 'pip -V' at the windows command line or in Python IDLE ?
AND... ditto for the line suggested earlier in this thread...
pip install beautifulsoup4 requests lxml
I tried it in IDLE and got an error...

>>> pip install beautifulsoup4 requests lxml
SyntaxError: invalid syntax
with "installl" highlighted in red.

Thanks for the help folks.
at commant line, which is also where you install packages.
I suggest you take snippsat's tutorial (as suggested in this thread)
They are quite good.
Roger. Will do. Thanks :-)