过客己 2019-04-30 10:17 采纳率: 80%
浏览 827
已采纳

在win的VS code上运行tornado项目报路径错误

错误信息:

Traceback (most recent call last):
  File "F:\xvni_hj\tornado_web\lib\site-packages\tornado\web.py", line 1697, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "F:\xvni_hj\tornado_web\test_web\user\views.py", line 11, in get
    self.render('index.html')
  File "F:\xvni_hj\tornado_web\lib\site-packages\tornado\web.py", line 856, in render
    html = self.render_string(template_name, **kwargs)
  File "F:\xvni_hj\tornado_web\lib\site-packages\tornado\web.py", line 1002, in render_string
    t = loader.load(template_name)
  File "F:\xvni_hj\tornado_web\lib\site-packages\tornado\template.py", line 445, in load
    self.templates[name] = self._create_template(name)
  File "F:\xvni_hj\tornado_web\lib\site-packages\tornado\template.py", line 476, in _create_template
    with open(path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\xvni_hj\\tornado_web\\test_web\\user\\templates\\index.html'

文件 :

manage.py:

图片说明

view.py:

图片说明

init.py:

图片说明

图片说明

是只能在Linux下运行吗?

  • 写回答

1条回答

  • oyljerry 2019-04-30 10:45
    关注

    电脑上根据路径F:\xvni_hj\tornado_web\test_web\user\templates\index.html
    找一下文件存在不存在,是否路径有问题

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 github符合条件20分钟秒到账,github空投 提供github账号可兑换💰感兴趣的可以找我交流一下
  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?