File contains no section headers when initialize database

I am installing tryton for the first time after running the command

trytond-admin -c /etc/tryton/tryton.conf -d tryton --all

I am getting this error which i am unable to find google.

Traceback (most recent call last):
  File "/home/hassan/.local/bin/trytond-admin", line 18, in <module>
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/", line 84, in update_etc
    read_files =
  File "/usr/lib/python2.7/", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/tryton/tryton.conf, line: 1
'path = /home/etc/tryton/\n'

Sometimes this errors occurs

 raise IOError('Database "%s" doesn\'t exist!' % db_filename)
IOError: Database "tryton.sqlite" doesn't exist!

I dont understand i am using postgres then why is it giving me error of sqlite

It seems your tryton.conf is misconfigured.

See documentation here: Configuration file for Tryton — trytond latest documentation

this is my configuration file

path = /Tryton/tryton.conf

root = /home/hassan
hostname = hassan

# uri = database://username:password@host:port/

# Settings for the JSON-RPC network interface

This is certainly a problem. Try testing without this line.

Do try to test one change at a time.
Start with an almost empty file, and add one line at a time, test and see if it has the expected result.

this error changed to

Traceback (most recent call last):
  File "/home/hassan/.local/bin/trytond-admin", line 21, in <module>
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/", line 54, in run
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/", line 152, in init
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/", line 105, in start
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/modules/", line 341, in register_classes
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/", line 5, in <module>
    from .translation import *
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/", line 19, in <module>
    from relatorio.reporting import MIMETemplateLoader
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/", line 12, in <module>
    from . import templates
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/", line 6, in <module>
    __import__('relatorio.templates.%s' % name)
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/", line 16, in <module>
    import urllib.parse
ImportError: No module named parse

I tried

pip install parse

which I found from stackoverflow but still issue

To me it seems like you have a problem with the trytond installation.
How did you install trytond?

What version of trytond are you using?
Btw, please try to use the latest (6.6).
Also Python 2.x is deprecated, so you should use at least 3.7+

I am using python2.7 and trytond 4.8 as per my organization requirements. cant shift to latest. any solution for python2.7 and trytond 4.8

I guess the oldest LTS release is 5.0

So 4.8 is unsupported, also I do not have experience with that version.

From my point of view, we are trying to make current tryton better, so I am guessing you need to get commercial support for 4.8.

Python2.7 is deprecated since 1st January 2020

Tryton 4.8 is the latest version that supported Python2.7 and is also deprecated since November 2019.

I will recomend switching to python3 which will support newer series which are alreay mantained.

The problem is that you are using a relatorio version which only support Python3, but as you are using python2 an error is raised. You should downgrade to a version that supports python2.

I guess you will have the same issue for other required libraries so it will be easier to upgrade your python version than downgrading all dependencies.