问题描述
我使用在我的
。我遵循Google提供的Django示例,但是我无法启动我的服务器,因为Python抛出一个 Windows 7
框中安装了 Google API客户端库Python
PIP ImportError:没有名为'clientsecrets'的模块
。
我已经验证 clientsecrets.py
位于 / path / to / python / Lib / site-packages
。
任何想法可能导致这个?我使用 Python版本3.3.3
和 Django版本1.6.1
我已经在/usr/lib/python3/dist-packages/oauth2client/client.py 中更改了
22 import base64
pre>
23 import clientsecrets
24 import copy
到:
22 import base64
23 import oauth2client.clientsecrets
24 import copy
然后解决了这个问题。这个问题只出现在Python 3中,Python 2.7是开箱即用的。
I installed the
Google APIs Client Library for Python
on myWindows 7
box usingpip
. I am following the Django example that Google provides, but I can't start my server because Python throws anImportError: No module named 'clientsecrets'
.I have verified that
clientsecrets.py
is located in/path/to/python/Lib/site-packages
.Any idea what could be causing this? I am using
Python version 3.3.3
andDjango version 1.6.1
解决方案I've changed in /usr/lib/python3/dist-packages/oauth2client/client.py the line:
22 import base64 23 import clientsecrets 24 import copy
to this:
22 import base64 23 import oauth2client.clientsecrets 24 import copy
and then that solved that problem. This problem came only with Python 3, with Python 2.7 that worked out of box.
这篇关于当使用Google Python API在Django中设置oauth2时,Python找不到模块'customersecrets'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!