1

I was setting up Doccano on my desktop to create a local clone using the following code below.

$ 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

Everything ran successfully until I go to http://127.0.0.1:8080. Then I get the error below. Could you please assist me with how to rectify these? Thanks.

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() ...

There are images available below to view the error reading in details:

Image of Error during template rendering

Image of Traceback error in _get_response

Image of Traceback error in render

Image of Traceback error in get_as_tags and in get_bundle

louis_guitton
  • 5,105
  • 1
  • 31
  • 33
Christol
  • 17
  • 7

1 Answers1

1

The Doccano documentation has two conflicting (docs and readme) suggestions on how you should run it.

In total there are as of now 4 ways to run doccano:

  • Docker Compose (recommended)
  • Docker
  • pip (experimental)
  • bare python + node <- what you're doing

You chose the last option, and it's the most complex because it has the most steps and the more potential for error. Please consider using Docker Compose to get started.

However, if you still want to go down the python + node route, it seems from your error message that you haven't run the steps for 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
louis_guitton
  • 5,105
  • 1
  • 31
  • 33