【问题标题】:Missing tutorial.conf file on cherrypy demo在cherrypy演示中缺少tutorial.conf文件
【发布时间】:2014-08-13 10:36:08
【问题描述】:

我已经按照此处的说明安装了cherryPy:

http://docs.cherrypy.org/en/latest/install.html

当我跑步时:

python -m cherrypy.tutorial.tut01_helloworld

我收到以下错误:

Traceback (most recent call last):
 File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
  "__main__", fname, loader, pkg_name)
 File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
   exec code in run_globals
 File "/usr/local/lib/python2.7/dist-packages/cherrypy/tutorial/tut01_helloworld.py",       line 34, in <module>
  cherrypy.quickstart(HelloWorld(), config=tutconf)
  File "/usr/local/lib/python2.7/dist-packages/cherrypy/__init__.py", line 169, in   quickstart
   _global_conf_alias.update(config)
   File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cpconfig.py", line 158, in update
   reprconf.Config.update(self, config)
   File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/reprconf.py", line 160, in update
   config = Parser().dict_from_file(config)
   File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/reprconf.py", line 232, in dict_from_file
   self.read(file)
    File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/reprconf.py", line 202, in read
    fp = open(filename)
   IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/cherrypy/tutorial/tutorial.conf'

这是 CherryPy 缺少/错误的地方,还是我应该做的?

谢谢

【问题讨论】:

    标签: python cherrypy


    【解决方案1】:

    遇到了同样的问题。在这里找到丢失的文件:

    Python34\Lib\site-packages\PURELIB\cherrypy\tutorial
    

    【讨论】:

      【解决方案2】:

      我在 OS X 10.10 Yosemite 上遇到了同样的问题。我从 github 源获取文件并将其复制到 /Library/Python/2.7/site-packages/cherrypy/tutorial:

      https://github.com/cherrypy/cherrypy/blob/master/cherrypy/tutorial/tutorial.conf
      

      【讨论】:

        【解决方案3】:

        如果你安装的是python 2.7版本,你可以在这个文件夹中找到tutorial.conf文件

        C:\Python27\cherrypy\tutorial
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-03-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-11-13
          • 2015-04-16
          相关资源
          最近更新 更多