1

我正在尝试使用此文档开始新项目:http: //pylonshq.com/docs/en/1.0/gettingstarted/(下载 go-pylons,使用它制作 virtualenv 等)。

但是当我尝试启动 helloworld 应用程序时,它会说:

$ paster serve --reload development.ini 
Starting subprocess with file monitor
Traceback (most recent call last):
  File "/home/users/vrusinov/workspace/mydevenv/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 276, in command
    relative_to=base, global_conf=vars)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 313, in loadapp
    **kw)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 203, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 223, in loadobj
    global_conf=global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadcontext
    global_conf=global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 270, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 401, in get_context
    section)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 423, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 353, in get_context
    global_conf=global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadcontext
    global_conf=global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 277, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 553, in get_context
    object_type, name=name)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 573, in find_egg_entry_point
    pkg_resources.require(self.spec)
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 666, in require
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 546, in resolve
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2436, in parse_requirements
  File "/home/users/vrusinov/workspace/mydevenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2404, in scan_list
ValueError: ('Expected version spec in', 'srvbakweb/', 'at', '/')

可能是什么原因?如何调试这个?

我在 gentoo linux 上使用 python 2.6。我还尝试使用 --no-site-packages 开关进行 go-pylons 和系统范围的 Pylons 安装。同样的错误:(

4

2 回答 2

2

经过一个小时的调试(setuptools 相当复杂,不是自记录工具),我找到了这个异常的原因:我使用了“paster create -t​​ pylons myappname/”。最后 / 导致了这个异常。

于 2011-02-07T21:00:57.130 回答
1

当我按照 Pylons 书启动服务器时,我遇到了类似的错误。事实证明,在创建项目时,我的路径也出现了错误。

我相信我跑了create -t pylons ~/dev/python/HelloWorld,这导致了一个错误(可能是因为波浪号,~)。

virtualenv我改为使用来自(请参阅 Pylons 书以供参考)和 run~/dev/python的activate 脚本create -t pylons HelloWorld,这解决了问题。

于 2012-09-17T13:51:11.447 回答