googleappengine安装pudb

时间:2014-09-22 14:35:07

标签: python google-app-engine buildout pudb

我想用pudb在google app引擎上调试我的python应用程序。我已经安装了buildout而没有使用virtualenv并为它创建了配置文件 buildout.cfg:

[buildout]
develop = .
parts =
    python
    app
    pudb
    nosetests
    zipsymlink

eggs =
    gaeapp

unzip = true

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

[app]
recipe = rod.recipe.appengine
url = https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.11.zip
server-script = dev_appserver
src = ${buildout:directory}/src/gaeapp
exclude = tests
zip-packages = True

[pudb]
recipe = zc.recipe.egg
eggs =
    gaeapp
    pudb

[nosetests]
recipe = zc.recipe.egg
eggs =
    NoseGAE
    WebTest
    gaeapp
    nose

extra-paths =
    ${buildout:directory}/etc
    ${buildout:directory}/parts/google_appengine
    ${buildout:directory}/parts/google_appengine/lib/antlr3
    ${buildout:directory}/parts/google_appengine/lib/fancy_urllib
    ${buildout:directory}/parts/google_appengine/lib/ipaddr
    ${buildout:directory}/parts/google_appengine/lib/webob_1_1_1
    ${buildout:directory}/parts/google_appengine/lib/webapp2/
    ${buildout:directory}/parts/google_appengine/lib/yaml/lib

interpreter = python

[zipsymlink]
recipe = svetlyak40wt.recipe.symlinks
path = ${app:src}
files = ${app:app-directory}/packages.zip

# Tools and dependencies
svetlyak40wt.recipe.symlinks = 0.2.1

我的app.yaml:

application: gaeapp
runtime: python27
threadsafe: true
api_version: 1

handlers:
- url: /_ah/spi/.*
  script: gae_api.APPLICATION

libraries:
- name: pycrypto
  version: latest

- name: endpoints
  version: 1.0

- name: setuptools
  version: latest

- name: webob
  version: latest

- name: webapp2
  version: latest

builtins:
- deferred: on

我的setup.py:

from setuptools import setup, find_packages

setup(
    name = "gaeapp",
    version = "1.0",
    url = 'http://github.com/blabla/gaeapp',
    license = 'BSD',
    description = "Just a test GAE app.",
    author = 'WOW',
    packages = find_packages('src'),
    package_dir = {'': 'src'},
    install_requires = ['setuptools', 'pudb']
)

一切安装正常,nosetests和devappserver都是有效的。运行服务器:

bin/devappserver parts/app

我试图在代码中使用pudb:

import pudb; pudb.set_trace();

只是看到这样的错误:

ImportError: No module named pudb

有没有办法将pudb与GAE应用程序一起使用?

1 个答案:

答案 0 :(得分:0)

您需要告诉rod.recipe.appengine要复制的鸡蛋:

packages =
    pudb
    urwid