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>
    config.update_etc(options.configfile)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/config.py", line 84, in update_etc
    read_files = self.read(configfile)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", 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

[web]
listen=127.0.0.1:8000
root = /home/hassan
hostname = hassan


[database]
# uri = database://username:password@host:port/
uri=postgresql://xxxx:xxxx@127.0.0.1:5432/tryton

[jsonrpc]
# Settings for the JSON-RPC network interface
listen=127.0.0.1:8000
data=/tryton/sao

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>
    admin.run(options)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/admin.py", line 54, in run
    installdeps=options.installdeps)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/pool.py", line 152, in init
    self.start()
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/pool.py", line 105, in start
    register_classes()
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 341, in register_classes
    import trytond.ir
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/__init__.py", line 5, in <module>
    from .translation import *
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/translation.py", line 19, in <module>
    from relatorio.reporting import MIMETemplateLoader
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/__init__.py", line 12, in <module>
    from . import templates
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/__init__.py", line 6, in <module>
    __import__('relatorio.templates.%s' % name)
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/opendocument.py", 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.