GoogleScraper(Python脚本)错误:“pkg_resources.DistributionNotFound:aiohttp”

时间:2015-05-23 16:59:44

标签: python-3.x aiohttp

我正在尝试使用GoogleScraper Python脚本处理Ubuntu 14.04 LTS,但是当我键入“./GoogleScraper -h”时出现以下错误

<code>
 ./GoogleScraper -h
Traceback (most recent call last):
  File "./GoogleScraper", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/roger/env/lib/python3.4/site-packages/pkg_resources.py", line 2716, in <module>
    working_set.require(__requires__)
  File "/home/roger/env/lib/python3.4/site-packages/pkg_resources.py", line 685, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/roger/env/lib/python3.4/site-packages/pkg_resources.py", line 588, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: aiohttp
</code>

如何安装此aiohttp软件包? I googled并且有点困惑。

这是我的“Python -V”输出

roger@vbox-ubuntu:~/env/bin$ python -V Python 2.7.6 roger@vbox-ubuntu:~/env/bin$ python3 -V Python 3.4.0

我还先运行了以下内容:

virtualenv --python python3 env source env/bin/activate pip install GoogleScraper sudo apt-get install python3-pip sudo pip3 install aiohttp

2 个答案:

答案 0 :(得分:3)

sudo pip3 install aiohttp

应解决您的问题(如果尚未安装pip,则以sudo apt-get install python3-pip开头)

答案 1 :(得分:2)

看起来我的问题很多都在运行&#34; sudo apt-get install&#34;在我当地的环境中。

我的修复程序是从一个全新的Ubuntu 14.04 LTS安装开始,然后运行以下代码:

sudo apt-get install python-virtualenv python3-pip liblz-dev python-dev libxml2-dev libxslt-dev zlib1g-dev python3-dev libmysqlclient-dev ubuntu-desktop chromium-chromedriver google-chrome-stable

之后,我在作者的网站上运行了以下命令:

virtualenv --python python3 env source env/bin/activate pip install GoogleScraper sudo pip3 install aiohttp

之后,我得到了#S; GoogleScraper -h&#34;按预期输出帮助文件。

相关问题