Initializing the Tryton database & starting the Tryton server

Sorry for the following being so lengthy but finally was able to get back working at Tryton server.
I used pip3 to install v6.8.6 of the Tryton server as well as psycopg2 to interface with the Postgres database with “apt -y install python3-psycopg2”. I then installed all the modules with “apt-get install -y tryton-modules-all”.

I added the Postgresql role & database with “CREATE USER tryton WITH SUPERUSER PASSWORD ‘tryton’;”
“CREATE DATABASE tryton OWNER tryton TEMPLATE=template0 ENCODING=‘utf-8’ LC_COLLATE=‘en_US.UTF-8’ LC_CTYPE=‘en_US.UTF-8’;” Initializing the database with “trytond-admin -c /etc/tryton/trytond.conf -d tryton --all” however did not produce any results, no tables were created & I was not presented with a prompt for username & password.

As a result, when starting the Tryton server with “trytond -c /etc/tryton/trytond.conf -d tryton”, exceptions occur which follow:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 52, in import_module
    module = importlib.import_module(fullname)
  File "/usr/lib/python3.10/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'trytond.modules.authentication_sms'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/trytond", line 42, in <module>
  File "/usr/local/lib/python3.10/dist-packages/trytond/", line 108, in start
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 365, in register_classes
    the_module = import_module(module)
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 76, in import_module
    module = spec.loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1063, in load_module
  File "<frozen importlib._bootstrap_external>", line 888, in load_module
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/trytond/modules/authentication_sms/", line 5, in <module>
    from . import res
  File "/usr/lib/python3/dist-packages/trytond/modules/authentication_sms/", line 54, in <module>
    class UserLoginSMSCode(ModelSQL):
  File "/usr/lib/python3/dist-packages/trytond/modules/authentication_sms/", line 62, in UserLoginSMSCode
    user_id = fields.Integer('User ID', select=True)
TypeError: Field.__init__() got an unexpected keyword argument 'select'

Are there supposed to be environment variables set? What else could I possibly being doing wrong?

To fix this error you need to install the trytond.modules.authentication_sms Module
try this:
pip install trytond-authentication-sms

The traceback is because you are mixing code from different series. The select=True argument was removed in 6.4 release but you say that you use the 6.8 series.

IIRC debian packages only support the LTS series, so probably you installed the 6.0 series and then mixed with a 6.8 version when using pip.

If you want to use latest series (which are 7.0 now) probably the best is to use pip to isntall them.

I did this but was told that it was already installed. Still working on a solution to start working with Tryton.

This was my second go-around. I removed tryton server along with all dependencies & then performed a re-install. I’m guessing that some remnants from the earlier version were left behind. At any rate, I have the Ubuntu 22.04 LTS installed onto a VM so not a deal breaker to wipe & reinstall the OS.
I am getting ready to install the v7.x server along with all the modules. Will there be any issue running with the current modules using the same command "apt-get install -y tryton-modules-all”?

On another note, if the server is running the v7.x, will the current desktop app which is v6.8 work with the v7 server?

Appreciate all your help. Update… I did install v7.0.1 of the server & v7.0.2 of the desktop app. The desktop app works fine but the server generates a file not found error & so I do not believe it is starting as I am unable to connect to it using the desktop client.
I ran the pip3 install trytond_ but that just generates a different file not found error. Sample below:
Output from starting the server:

jon@ml110-vm2:~$ sudo trytond -c /etc/tryton/trytond.conf -v -d tryton
Traceback (most recent call last):
  File "/usr/local/bin/trytond", line 42, in <module>
  File "/usr/local/lib/python3.10/dist-packages/trytond/", line 108, in start
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 308, in register_classes
    for node in create_graph(get_modules(with_test=with_test)):
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 100, in create_graph
    info = get_module_info(module)
  File "/usr/local/lib/python3.10/dist-packages/trytond/modules/", line 39, in get_module_info
    with tools.file_open(os.path.join(name, 'tryton.cfg')) as fp:
  File "/usr/local/lib/python3.10/dist-packages/trytond/tools/", line 28, in file_open
    path = find_path(name, subdir)
  File "/usr/local/lib/python3.10/dist-packages/trytond/tools/", line 70, in find_path
    raise FileNotFoundError("No such file or directory: %r" % name)
FileNotFoundError: No such file or directory: 'analytic_sale/tryton.cfg'

make sure that you have trytond-analytic-sale installed:

pip install trytond-analytic-sale

I have done this but when attempting to start the server again, another different module crops up. Pretty soon it is just going around in circles repeating itself

I think you miss installing some dependencies…

Yes, this causes problems as installs from apt cache which may not match the current series.

The series of the client and the server must match. If you try to connect with a client to non matching series you will get an error message complaining about version missmatch.

Did you use editable module? If yes maybe you get hit with this issue:

Otherwise please share how your instalation steps and also which python version you are using.

It seems that you are using a database that you have initialized with a different setup.
You should start with a new database, initialize it and then launch the server (if there were no issues in previous steps).

The only thing I see is that you are messing up your installation. Mixing distribution packages with global pip install will most of the times run into trouble. I would advice to use a Python Virtual Environment and install Tryton there with pip completely. If you mess up your installation, remove the environment and start again.

Some steps:

  1. Have a tryton user in PostgreSQL, create a new empty database with the tryton user as the ‘admin’ user
  2. create a new virtual environment (search the internet how to do that) and activate it
  3. install trytond and if needed other modules with pip install
  4. install psycopg2-binary or install this one through you package manager
  5. create a minimal trytond.conf in the environment where the database connection is defined
  6. run trytond-admin -c trytond.conf -d <your-database> --all -vv and watch the output
  7. install extra packages when the command fails with no module found
  8. when everything worked without error, run `trytond -c trytond.conf -d
  9. connect with the client
  10. when everything works, install more Tryton modules with pip install

Of course you can also look at the docker version of Tryton. Try to search this forum for more information.

1 Like

I began with a new Ubuntu 22.04 installation, installed Postgres & psycopg2. I created a Postgres user & database:


I installed Tryton with pip3 install trytond==7.0.1. I installed all the modules using sudo apt -y install tryton-modules-all - Installing these created the etc/tryton folder along with the trytond.conf file. I edited the trytond.conf file uri entry to use Postgres as the default and to listen on I ran trytond-admin -c ./tryton.conf -v -d tryton --all but did not get the advertised prompt for a user & password.

Sorry, forgot… Using Python 3.11.6

Everything worked this time. I only have the bare essentials, basic modules. So,before I proceed farther, I understood any or all modules can be installed by using pip install -r . I downloaded the modules list and prepended all the module names with trytond_ as I read that without this being prepended, the procedure would fail. Am I on the right track with module installation?

To be clear, you started the client and was able to login?

That’s correct, just do a pip install -r trytond_account-invoice for example and now you have installed the account-invouice module with all it’s dependencies.

However, Tryton itself doesn’t know yet that you have installed a new module, you have to tell Tryton to walk through it’s modules directory and search for new modules. You can do that by trytond-admin -c <conf-file> -d <database> -m . Maybe a restart of Trytond is needed to refresh the cache and session.

Yes, installing into the virtual environment definitely helped.

I understood from an article I read that by using the -r argument tells pip to look in the file provided to loop through contents of the file (module names) & install the modules listed in the file. in this case, the modules.txt file I downloaded.

Yes that is what -r means, read the contents of the requirements file, I accidentally added it to the command, but it shouldn’t be used there.

Mostly the requirements file is used to backup / store which installed packages are installed in the environment and what their version is. So when you want to start over you can use that file to kind of replicate the new environment. It’s also used by developers to setup their development environment so they have an almost exact copy. You can create such a file with pip freeze --local > requirements.txt to get the packages and their versions installed. Then take a look at the requirements.txt.

That will not work, because the modules.txt contains the module name in Tryton itself and not in the PyPi registry. For example: You want to do invoicing in Tryton

  • In Tryton the module is called account_invouice
  • In the PyPi registry the module is called trytond_account-invouice

A very simple script to install all the modules



for i in $(curl -sS $modules); do
    pip install --upgrade trytond-$i==7.0.*

This script will install all the modules. It will take some time because pip is trying to install every module and it’s dependencies. But modules depend on each other so some are already installed and tried again.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.