【问题标题】:Can't Use Pycrypto in Google App Engine Production无法在 Google App Engine Production 中使用 Pycrypto
【发布时间】:2014-06-16 21:51:53
【问题描述】:

我在 Python 2.7 下的 GAE 开发环境中成功使用了 Pycrypto vs. 2.6。但是,将其部署到 Google 生产时,我在日志中看到以下错误:

from Crypto.Cipher import _AES ImportError: cannot import name _AES

我的应用程序.Yaml:

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

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

- url: .*
  script: main.app
  secure: always

libraries:
- name: webapp2
  version: "2.5.2"
- name: pycrypto
  version: "2.6"

有问题的 Python 调用:

from Crypto.Cipher import AES

查看 Google 支持文档,他们确实将 Pycrypto 2.6 列为受支持。我还尝试为版本输入“最新”并收到相同的错误。再次在我的本地机器上开发 GAE 时,它运行良好。

【问题讨论】:

    标签: python google-app-engine pycrypto


    【解决方案1】:

    问题已解决。我的 App Engine 项目目录中有一个 Windows 安装目录,名为“Crypto”。当应用程序加载器加载文件时,它还包含这个与谷歌在生产中加载的目录冲突的目录。从本地项目目录中删除此目录可在下次推送到 Google 时解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多