【问题标题】:oauth2 in GAE with pythonGAE中的oauth2与python
【发布时间】:2013-04-10 21:21:54
【问题描述】:

我想使用一个使用 oauth2 的库。很遗憾,Google 应用引擎无法找到 oauth2 作为库。

当我浏览我的项目时,出现以下错误

    import oauth2 as oauth
    ImportError: No module named oauth2

我无法使用谷歌应用引擎的oauth,因为我必须更改整个库。

有什么建议可以让 oauth2 在 GAE 上运行吗?

库使用这个版本的oauth2 enter link description here

【问题讨论】:

  • developers.google.com/appengine/docs/python/oauth/overviewfrom google.appengine.api import oauth
  • 如果我使用这个库,那么我的自定义库将无法工作,因为它使用 oauth2 代码。
  • 您将oauth2 库放在哪里?这可能会有所帮助:stackoverflow.com/questions/279237/…?
  • 我使用的是简易安装,它位于 C:\Python27\Lib\site-packages\oauth2-1.5.170-py2.7.egg\
  • 如果你想在 appengine 上部署你的应用,你必须在你的项目文件夹中包含你的库,因为你不能改变谷歌应用服务器环境,即你在 appengine 服务器上没有oauth2

标签: python google-app-engine oauth-2.0


【解决方案1】:

好的,您必须先安装软件包。它将安装到您的默认 python 库中。有 3 种方法可以做到这一点:

第一路(MAC):

    sudo easy_install oauth2

第二种方式:

    pip install oauth2

第三种方式(如果您想更好地控制安装位置):

  1. 从这里下载压缩文件https://github.com/simplegeo/python-oauth2/archive/master.zip
  2. 然后解压缩文件并导航到下载到的文件夹。
  3. 运行

    python3 setup.py 
    

    python setup.py
    

取决于你想要哪个包(python3 或 2)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-17
    • 2013-06-13
    • 2012-08-09
    • 2011-08-27
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 1970-01-01
    相关资源
    最近更新 更多