PasteScript和PasteDeploy不能与Python2.7一起使用

时间:2013-09-24 05:11:13

标签: python-2.7 cygwin paster

我们正在使用PasteScript和PasteDeploy来启动我们的python服务。在我们从Python2.6迁移到Python2.7之前,情况非常好。

PasteScript = 1.7.5,PasteDeploy = 1.5.0

# Launch
$ paster serve --reload conf/dev.ini
  Starting subprocess with file monitor

在paster中放入一些调试语句后,我们发现入口点在serve.py

# In serve.py        
def command(self) 
    ...
    app = self.loadapp(app_spec, name=app_name,
                           relative_to=base, global_conf=vars)
    ...
# In deploy.py
def loadapp(uri, name=None, **kw):
    return loadobj(APP, uri, name=name, **kw)

def loadobj(object_type, uri, name=None, relative_to=None, global_conf=None):
    print "I see this"
    context = loadcontext(object_type,uri, name=name, 
                  relative_to=relative_to, global_conf=global_conf)
    print "I do not see this"
    return context.create()

该过程只是在loadcontext调用时终止而没有错误。我用Python2.6做了同样的练习,它按预期工作。所以我假设我的PasteScript和PasteDeploy与Python2.7不兼容,但由于网站没有说明兼容性,因此无法确认。

有人可以帮忙吗?感谢。

1 个答案:

答案 0 :(得分:0)

回答我自己的问题。

几个问题:

1)贴纸失败,因为未安装“请求”模块。值得注意的是,Paster没有抛出任何错误并且默默地死去。

2)所以我尝试安装“请求”,但也没有发生特定错误。刚说安装错误:egg_pkg_info失败

我们猜测可能是64位的Cygwin搞砸了。所以继续在32位Cygwin上进行同样的练习。一切都按预期工作。所以在一天结束时,它既不是Paster也不是Python。