我pygoogle
在 Python 上安装了用于 Google 搜索的模块。我从这里下载了模块包并成功运行 Pythonsetup.py
安装:
navyad@ubuntu:~/Downloads/pygoogle-0.6$ sudo python setup.py install
running install
running build
running build_py
running install_lib
running install_egg_info
removing '/usr/local/lib/python2.7/dist-packages/pygoogle/pygoogle-0.6.egg-info' (and everything under it)
Writing /usr/local/lib/python2.7/dist-packages/pygoogle/pygoogle-0.6.egg-info
creating /usr/local/lib/python2.7/dist-packages/pygoogle.pth
但是在导入pygoogle
模块时,我得到了一个ImportError
:
>>> from pygoogle import pygoogle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pygoogle
然后,我检查了安装文件夹/usr/local/lib/python2.7/dist-packages/pygoogle
,发现没有__init__.py
文件。
似乎正因为如此,它给了ImportError
.
为什么__init__.py
没有创建文件?