简体   繁体   中英

No module named httplib2 but httplib2 installed

im installed httplib2 using pip but when i write this code its give me error No module named httplib2 why ? the code

import httplib2
from BeautifulSoup import BeautifulSoup, SoupStrainer

http = httplib2.Http()
status, response = http.request('http://www.google.com')

for link in BeautifulSoup(response, parseOnlyThese=SoupStrainer('a')):
    if link.has_attr('href'):
    print link['href']

Try uninstalling and reinstalling using :

Uninstall:

pip uninstall httplib2 

Reinstall:

pip install httplib2

List installed packages:

pip freeze

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM