No module named google.protobuf

后端 未结 9 669
滥情空心
滥情空心 2020-12-09 08:17

I am trying to run Google\'s deep dream. For some odd reason I keep getting

ImportError: No module named google.protobuf

after t

相关标签:
9条回答
  • 2020-12-09 09:08

    I installed the protobuf with this command:

    conda install -c anaconda protobuf=2.6.1
    

    (you should check the version of protobuf)

    0 讨论(0)
  • 2020-12-09 09:13

    Locating the google directory in the site-packages directory (for the proper latter directory, of course) and manually creating an (empty) __init__.py resolved this issue for me.

    (Note that within this directory is the protobuf directory but my installation of Python 2.7 did not accept the new-style packages so the __init__.py was required, even if empty, to identify the folder as a package folder.)

    ...In case this helps anyone in the future.

    0 讨论(0)
  • 2020-12-09 09:13

    In my case, MacOS has the permission control. sudo -H pip3 install protobuf

    0 讨论(0)
提交回复
热议问题