无法使用Python和Cloud 9导入LXML

时间:2016-01-13 21:20:27

标签: python web-scraping lxml cloud9-ide

我试图运行一个简单的脚本并从网页中提取一些值。但是,我收到错误'无法导入lxml'。这是完整的脚本

from lxml import html

page = requests.get('http://awebpage.com')
tree = html.fromstring(page.content)
names = tree.xpath('someXPath')
print names

我做了pip install lxml,它说,

Requirement already satisfied (use --upgrade to upgrade): lxml in /usr/lib/python2.7/dist-packages
Cleaning up...

编辑:我也做了pip冻结,就像另一张检查一样,以确保它已安装。

0 个答案:

没有答案