Python 未安装名为httplib2但未安装httplib2的模块
我用pip安装了httplib2,但是当我写这段代码时,它给了我一个错误 没有名为httplib2的模块 为什么? 代码Python 未安装名为httplib2但未安装httplib2的模块,python,desktop-application,httplib2,pip,Python,Desktop Application,Httplib2,Pip,我用pip安装了httplib2,但是当我写这段代码时,它给了我一个错误 没有名为httplib2的模块 为什么? 代码 import httplib2 from BeautifulSoup import BeautifulSoup, SoupStrainer http = httplib2.Http() status, response = http.request('http://www.google.com') for link in BeautifulSoup(response, p
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']
尝试使用以下方法卸载和重新安装: 卸载: 重新安装: 列出已安装的软件包:
您使用什么命令安装httplib2?安装正确吗?你能打开一个Python shell并在那里导入httplib2吗?pip安装httplip2httplip2吗?你是说httplib2,对吗?您确定已正确安装库吗?您是否已将其安装到python的正确版本中?您可以通过运行
pip freeze
并检查包名的输出来检查包是否已实际安装。这就是打包的BeautifulSoup==3.2。httplib2==0.9 pypm==1.4.3 pythonselect==1.3 pywin32==218.3 virtualenv==1.11.6
pip uninstall httplib2
pip install httplib2
pip freeze