Can not switch from sqlite to postgresql backend

At the moment I can’t login anymore with the client after I tried to deactivate sale_stock_quantity.

Traceback (most recent call last):
File “/usr/bin/tryton”, line 67, in
File “/usr/lib/python2.7/dist-packages/tryton/”, line 293, in run
File “/usr/lib/python2.7/dist-packages/tryton/gui/”, line 876, in sig_login
File “/usr/lib/python2.7/dist-packages/tryton/common/”, line 1050, in init
File “/usr/lib/python2.7/dist-packages/tryton/gui/”, line 873, in
host, port, database, username, parameters, language)
File “/usr/lib/python2.7/dist-packages/tryton/”, line 72, in login
result = connection.common.db.login(username, parameters, language)
File “/usr/lib/python2.7/”, line 1243, in call
return self.__send(self.__name, args)
File “/usr/lib/python2.7/dist-packages/tryton/”, line 296, in __request
raise Fault(*response[‘error’])
Fault: <Fault u"‘res.user’": u’Traceback (most recent call last):\n File “/trytond/”, line 70, in dispatch_request\n return endpoint(request, **request.view_args)\n File “/trytond/protocols/”, line 41, in rpc\n request, database_name, *request.rpc_params)\n File “/trytond/protocols/”, line 54, in login\n database_name, user, parameters, language=language)\n File “/trytond/”, line 24, in login\n User = pool.get(‘res.user’)\n File “/trytond/”, line 170, in get\n return self._pool[self.database_name][type][name]\nKeyError: ‘res.user’\n’>

I think I will start from scratch with tryton and a postgresql database.

Have you tried trytond-admin -d database --all?

trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
Traceback (most recent call last):
File “/usr/bin/trytond-admin”, line 21, in
File “/usr/lib/python3/dist-packages/trytond/”, line 54, in run
File “/usr/lib/python3/dist-packages/trytond/”, line 153, in init
lang=lang, installdeps=installdeps)
File “/usr/lib/python3/dist-packages/trytond/modules/”, line 472, in load_modules
File “/usr/lib/python3/dist-packages/trytond/modules/”, line 436, in _load_modules
graph = create_graph(module_list)[0]
File “/usr/lib/python3/dist-packages/trytond/modules/”, line 191, in create_graph
- set((p[0] for p in packages))))
trytond.exceptions.MissingDependenciesException: [‘sale’]

Trying below:
Pip install trytond-sale

Then update all module again

At the moment I’m struggling with
trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
after changing to postgresql and creating the database tryton with user postgres.

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/trytond/backend/”, line 32, in get
‘trytond.backend’, db_type)
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/trytond-admin”, line 21, in
File “/usr/lib/python3/dist-packages/trytond/”, line 20, in run
Database = backend.get(‘Database’)
File “/usr/lib/python3/dist-packages/trytond/backend/”, line 34, in get
raise exception
File “/usr/lib/python3/dist-packages/trytond/backend/”, line 26, in get
File “/usr/lib/python3/dist-packages/trytond/backend/postgresql/”, line 4, in
from .database import *
File “/usr/lib/python3/dist-packages/trytond/backend/postgresql/”, line 16, in
from psycopg2 import connect, Binary
ModuleNotFoundError: No module named ‘psycopg2’

Complete output from command python egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-Pdd7e1/trytond-sale/”, line 8, in
from configparser import ConfigParser
ImportError: No module named configparser


Command “python egg_info” failed with error code 1 in /tmp/pip-build-Pdd7e1/trytond-sale/

Looks like you are still using the unsupported Python 2.
Tryton is Python 3 only.

Your environment may default using python2.

Can you try
Pip3 install trytond-sale

pip3 install trytond-sale
Requirement already satisfied: trytond-sale in /usr/lib/python3/dist-packages

It looks like your database was initialized but with partially installed modules.
Once all dependency modules are installed, you must run the update of the database with the option --activate-dependencies to ensure new dependencies are activated.

trytond-admin -c /etc/tryton/trytond.conf -d tryton --activate-dependencies

trytond-admin: error: unrecognized arguments: --activate-dependencies

I think you are using a no more supported version of Tryton. You must use at least the series 5.0.

Yes, v4.6.5, Linuxmint package. I was hoping to be able to upgrade to the latest version but maybe it’s better to start with the latest version from scratch. Sadly there seem to be not packages for Linuxmint.

Is there any reason you stick to 4.6.5?

Although no package, but installing from source of trytond should be easy also.
Just clone the source code and the the root folder “python3 install” should already install.

Yes, I will go this way. All that stuff is very new to me but tryton seems to be a very interesstingly project. I got the source of tryton-5.4.3.tar.gz trytond-5.4.3.tar.gz and tryton-sao-5.4.2.tgz and will install needed modules gradually.

“python3 install”
ModuleNotFoundError: No module named ‘setuptools’

I have no clue with python.

apt-get install python3-setuptools did the trick.

I would suggest to use a Python virtual environment. In that way you keep your OS clean and install everything inside that environment. You then can also use pip to install and upgrade the different trytond-* packages and their dependencies.
for psycopg2 I always install the psycopg2-binary with pip (inside the environment) so no need for a compiler to compile the binary.