GAE dev_appserver“没有名为lxml的模块”

时间:2012-05-24 19:33:13

标签: google-app-engine python-2.7 lxml

似乎lxml在dev_appserver中不适用于我。我的测试项目是使用windows python sdk 1.6.6构建的import lxml行。 “没有名为lxml的模块”。我假设安装了python版本,但我有Python 2.7。

import webapp2
import lxml

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.out.write('Hello world!')

app = webapp2.WSGIApplication([('/', MainHandler)],
                              debug=True)

===

application: teslxml
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: lxml
  version: latest

==

dev_appserver.py teslxml

2 个答案:

答案 0 :(得分:7)

更新:这不再是真的,lxml现在开箱即用。 https://cloud.google.com/appengine/docs/standard/python/tools/built-in-libraries-27


lxml不是开箱即用的Google App Engine,您需要install it

答案 1 :(得分:0)

我一直得到'no module named lxml'错误,但无法单独安装模块,我通过告诉pip安装特定版本号来解决这个问题,如此;

  

pip install lxml == [versionnumber]