谷歌搜索无法正常工作,因为我无法找到urllib2

时间:2018-01-23 18:06:38

标签: python anaconda urllib2 google-search google-search-api

我试图让谷歌搜索API在这里工作(我使用这个https://github.com/anthonyhseb/googlesearch因为某些原因我conda install Google-Search-API - 其他API显然更广泛使用 - 它没有找到它。)

所以,我使用以下代码:

from googlesearch.googlesearch import GoogleSearch
response = GoogleSearch().search("something")
print(response)

我得到了:

ImportError: No module named 'urllib2'

当我尝试通过终端安装urllib2时,我得到:

Could not find a version that satisfies the requirement urllib2 (from versions: )
No matching distribution found for urllib2

我使用的是Python 2.7.13和Anaconda自定义(x86_64)。

0 个答案:

没有答案