0

我正在我的桌面上设置 Doccano 以使用以下代码创建本地克隆。

$ git clone https://github.com/chakki-works/doccano.git
$ cd doccano
$ pip install -r requirements.txt
$ cd app
$ python manage.py createsuperuser 
Username: admin
Email address: admin@example.com
Password: **********
Password (again): *********
Superuser created successfully.
$ python manage.py runserver

一切顺利,直到我去http://127.0.0.1:8080。然后我得到下面的错误。你能帮我解决这些问题吗?谢谢。

OSError at /
Error reading C:\Users\okekec\doccano\app\server\static\webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 2.1.11
Exception Type: OSError
Exception Value:    
Error reading C:\Users\okekec\doccano\app\server\static\webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
Exception Location: C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\webpack_loader\loader.py in _load_assets, line 32
Python Executable:  C:\Users\okekec\AppData\Local\Continuum\anaconda3\python.exe
Python Version: 3.6.10
Python Path:    
['C:\\Users\\okekec\\doccano\\app',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\python36.zip',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\DLLs',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\lib',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\win32',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\win32\\lib',
 'C:\\Users\\okekec\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\Pythonwin',
 '../api']
Server time:    Fri, 23 Oct 2020 10:52:37 +0000

Error during template rendering
In template C:\Users\okekec\doccano\app\server\templates\base.html, error at line 0

Error reading C:\Users\okekec\doccano\app\server\static\webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
1   {% load static %}
2   {% load analytics %}
3   <!DOCTYPE html>
4   <html>
5   <head>
6     {% google_analytics %}
7     <meta charset="utf-8">
8     <meta http-equiv="X-UA-Compatible" content="IE=edge">
9     <meta name="viewport" content="width=device-width, initial-scale=1">
10    <title>doccano - Document Annotation Tool</title>
Traceback Switch to copy-and-paste view
C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\webpack_loader\loader.py in _load_assets
            with open(self.config['STATS_FILE'], encoding="utf-8") as f: ...
▶ Local vars
During handling of the above exception ([Errno 2] No such file or directory: 'C:\\Users\\okekec\\doccano\\app\\server\\static\\webpack-stats.json'), another exception occurred:
C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\handlers\exception.py in inner
            response = get_response(request) ...
▶ Local vars
C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\handlers\base.py in _get_response
                response = self.process_exception_by_middleware(e, request) ...
▶ Local vars
C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\handlers\base.py in _get_response
                response = response.render() ...

下面有图片可以详细查看错误读数:

模板渲染期间的错误图像

_get_response 中的 Traceback 错误图像

渲染中的 Traceback 错误图像

get_as_tags 和 get_bundle 中的 Traceback 错误图像

4

1 回答 1

0

Doccano 文档有两个关于如何运行它的相互冲突的( docsreadme )建议。

到目前为止,总共有 4 种运行 doccano 的方法:

  • Docker 撰写(推荐)
  • 码头工人
  • 点子(实验性)
  • 裸 python + node <- 你在做什么

您选择了最后一个选项,它是最复杂的,因为它的步骤最多且出错的可能性更大。请考虑使用 Docker Compose 开始。

但是,如果您仍然想走 python + node 路线,从您的错误消息看来,您还没有运行 Node.js 的步骤:

# Steps for Python
$ git clone https://github.com/doccano/doccano.git
$ cd doccano/app
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py create_roles
$ python manage.py create_admin --noinput --username "admin" --email "admin@example.com" --password "password"
$ python manage.py runserver

# Steps for Node.js
$ cd doccano/frontend
$ yarn install
$ yarn dev
于 2020-12-27T11:44:15.867 回答