我试图让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 回答
应该解决你的问题(如果还没有安装pip,则前面是
sudo apt-get install python3-pip
)看起来我的很多问题都是在我的本地环境中运行“sudo apt-get install” .
我的修复是从一个全新的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
之后,我能够按预期输出“GoogleScraper -h”来输出帮助文件 .