ImportError:没有名为generator的模块

时间:2017-01-26 13:15:41

标签: python google-api google-api-python-client

 File "./home/quickstart.py", line 2, in <module>
        import httplib2
      File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 29, in <module>
        import email
      File "/home/sushant/home/email.py", line 7, in <module>
        from apiclient import discovery
      File "/usr/local/lib/python2.7/dist-packages/apiclient/__init__.py", line 19, in <module>
        from googleapiclient import discovery
      File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 41, in <module>
        from email.generator import Generator as BytesGenerator
    ImportError: No module named generator

使用google-api-python-client并收到此错误。请帮忙 !!!

1 个答案:

答案 0 :(得分:4)

您有一个名为“email.py”的本地文件,它隐藏了stdlib模块。重命名您的文件。