I was setting up Doccano on my desktop to perform sequence labeling tasks. I followed the instructions from a website on how to setup Doccano. Everything was working fine until I got to the last code below where I experienced migration errors.

$ git clone https://github.com/chakki-works/doccano.git
$ cd doccano
$ pip install -r requirements.txt
$ cd app
$ python manage.py createsuperuser 

This is the error below after running the last code above on git bash

You have 29 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, api, auth, authtoken, contenttypes, sessions, social_django.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_user

File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user

The error says to Run 'python manage.py migrate. When I ran the code in my terminal I got an [Errno 2] No such file or directory. Please see below. Thanks for your help.

C:\Users\okekec>python manage.py migrate
python: can't open file 'manage.py': [Errno 2] No such file or directory
2

There are 2 best solutions below

1
On BEST ANSWER

Go to the folder where manage.py is and run the command there.

cd /okekec/doccano/app

ls

It should be able to see manage.py file.

Then python manage.py migrate

1
On

This is a Django project, so you are required to manually migrate the required models for the 29 apps that it's referring to.

It seems to me as though you are running this outside the directory that you've cloned

C:\Users\okekec>

should be

C:\Users\okekec\doccano>

There, it should have the manage.py file, i.e. the file should be in the current directory. This should then allow you to perform the migrations.