【问题标题】:Is xlrd supported in Google App Engine?Google App Engine 是否支持 xlrd?
【发布时间】:2012-10-19 21:18:54
【问题描述】:

我在 Google Groups 和这里看到过帖子提到在 Google App Engine 中使用 xlrd:

How do you read excel files with xlrd on Appengine

https://groups.google.com/forum/?fromgroups=#!searchin/google-appengine-python/xlrd/google-appengine-python/lMix6vXhvtA/O_ExzkGhsKEJ

但是当我尝试将它添加到 app.yaml 文件时,它显示“不支持库 xlrd”。此外,在 3rd 方库列表中,我没有看到 xlrd。

https://developers.google.com/appengine/docs/python/tools/libraries27

但是其他人似乎在 GAE 上使用它,那么 GAE 是否支持它?在过去,我能够成功导入 numpy。这是 app.yaml。在 main.py 我有“import xlrd”。非常感谢。

application: uploadsample
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.1" 
- name: xlrd
  version: "0.7.3"

【问题讨论】:

    标签: google-app-engine


    【解决方案1】:

    您可以在您的应用中包含任何您想要的纯 Python 第三方库。您没有在 app.yaml 中指定它们,这仅适用于 Google 在服务器上包含的第三方库。

    xlrd 本身不受“支持”,但它应该可以工作。

    【讨论】:

    • 谢谢你。当我从 app.yaml 中删除这些行时,它显示: ImportError:没有名为 xlrd 的模块。但是当我自己运行 Python IDLE 时,我可以导入 xlrd,没问题。你知道我该如何解决这个问题吗?再次感谢。
    • 部署时需要在应用目录中包含该模块的副本。
    • Woobie 在这里是正确的。我们不提供xldr。您必须将其与您的应用一起上传。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-27
    • 2014-08-05
    • 2020-02-21
    • 2013-11-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多