【问题标题】:Installing Unirest python module in Google App Engine在 Google App Engine 中安装 Unirest python 模块
【发布时间】:2014-05-07 08:01:34
【问题描述】:

您好,我是 GAE 和 python 的新手。我正在尝试使用 python 在 GAE 中创建小型 Web 应用程序。我打算在应用程序中使用Unirest 模块。

我按照this post 中的说明进行操作,但出现以下错误。

没有名为 poster.encode 的模块

如何在 GAE 中成功安装 unirest?

谢谢

【问题讨论】:

    标签: python google-app-engine python-module unirest


    【解决方案1】:

    import sys 添加到您的 ma​​in.py 并添加这些行。

    # inject './lib' dir in the path so that we can simply do "import ndb" or whatever there's in the app lib dir.
    if 'lib' not in sys.path:
        sys.path[0:0] = ['lib']
    

    在项目根目录下创建lib文件夹,并复制lib文件夹中的unirest文件夹。

    您现在可以导入 unirest 并使用您的库。

    但是,为什么不使用 Google App Engine 提供的标准方法和库呢?

    【讨论】:

    猜你喜欢
    • 2020-12-13
    • 2018-04-29
    • 2013-06-12
    • 1970-01-01
    • 1970-01-01
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多