Issue With Proteus Script - No module named 'trytond.backend.'

The environment is a mac.
I have a sqlite database file created and the database initiated with ‘trytond-admin -d database-name --all’ ( also activated the modules ).
I’m able to run the tryton server with this database.
I have a python proteus script, but when I run it I get the following error:
ModuleNotFoundError: No module named ‘trytond.backend.’

proteus does not use any default database backend, you must define it with TRYTOND_DATABASE_URI or a configuration file.

How do you define the environment variable if the database was at /Users/vincentbastos/db/database.sqlite?

I tried:
config = config.set_trytond(‘file:/Users/vincentbastos/db/database.sqlite’)
But I got the same error.

You must use:

config.set_trytond('sqlite://database')

an if the path /Users/vincentbastos/db/ is not the default path you must use a config file with [database] path.

Thank you.

This is what worked:

In the proteus.py file:

config = config.set_trytond('my_database', '.', config_file='/Users/vincentbastos/code/vb/my_module/trytond.conf')

And in trytond.conf:

[database]
uri=sqlite://
path=/Users/vincentbastos/db/

Also, I was able to get to the relevant code in the method _make_uri in:

tryton/trytond/trytond/backend/sqlite/database.py

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