【问题标题】:GAE SDK 1.9.5 and an InvalidCertificateExceptionGAE SDK 1.9.5 和 InvalidCertificateException
【发布时间】:2014-11-24 21:26:04
【问题描述】:

尝试在 osX Maverics 10.9.5 上使用 Python2.7.8 从 GAE SDK 1.95 导入测试平台 我收到了 InvalidCertificateException 错误。

    from google.appengine.ext import testbed   
  File "/usr/local/google_appengine/google/appengine/ext/testbed/__init__.py", line 120, in <module>  
    from google.appengine.api import urlfetch_stub   
  File "/usr/local/google_appengine/google/appengine/api/urlfetch_stub.py", line 34, in <module>  
    _fancy_urllib_InvalidCertException = fancy_urllib.InvalidCertificateException  
AttributeError: 'module' object has no attribute 'InvalidCertificateException'   

我查看了 fancy_url 模块和 InvalidCertificateException 类,所以我不明白为什么它没有导入。

显然其他人也有同样的错误,所以我尝试通过删除: urlfetch_cacerts.txtcacerts.txt 来纠正它:

GoogleAppEngineLauncher/Contents/Resources/GoogleAppEngineDefault.bundle/Content‌​s/Resources/google_appengine/lib/cacerts/

【问题讨论】:

    标签: google-app-engine python-2.7


    【解决方案1】:

    显然,GAE 安装程序创建了一个嵌套目录,通过复制以下内容已修复:

    cd /usr/local/google_appengine/lib
    cp fancy_urllib/fancy_urllib/__init__.py fancy_urllib/__init__.py 
    

    这是模块的结构错误,看起来这两个 init.py 文件是重复的:

    /usr/local/google_appengine/lib/fancy_urllib/__init__.py   # this file is empty
    /usr/local/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py # this file contains the functions.
    

    修正了错误

    【讨论】:

    • 谢谢!它解决了我在 GAE 1.9.18 中的问题
    • 比起复制,我认为更好的选择是创建一个链接,所以假设你在cd /usr/local/google_appengine/lib,然后做ln -f -r -s ./fancy_urllib/fancy_urllib/__init__.py -t fancy_urllib
    猜你喜欢
    • 2012-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 2011-11-25
    • 1970-01-01
    • 2013-05-19
    • 1970-01-01
    相关资源
    最近更新 更多