Hello,
I tried using the proteus library to automatically create and insert data to my gnuhealth installation.
The python script I wrote works perfectly fine as long as I run the script directly on the remote machine.
For automation purpose I am using ansible. I transfer my script to the remote machine and try to execute it, but I get a No module named 'trytond.backend.postgres'
error.
I can not figure out where this error is comming from, since the programm is running fine otherwise.
This is the full traceback:
"Traceback (most recent call last):",
" File \"tp.py\", line 183, in <module>",
" config.set_trytond(\"postgres:///health\")",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/proteus/config.py\", line 300, in set_trytond",
" _CONFIG.current = TrytondConfig(database, user, config_file=config_file)",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/proteus/config.py\", line 251, in __init__",
" Pool.start()",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/pool.py\", line 102, in start",
" register_classes()",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/modules/__init__.py\", line 316, in register_classes",
" import trytond.ir",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/ir/__init__.py\", line 4, in <module>",
" from .configuration import *",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/ir/configuration.py\", line 3, in <module>",
" from ..model import ModelSQL, ModelSingleton, fields",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/model/__init__.py\", line 3, in <module>",
" from .model import Model",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/model/model.py\", line 7, in <module>",
" from trytond.model import fields",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/model/fields/__init__.py\", line 4, in <module>",
" from .field import *",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/model/fields/field.py\", line 22, in <module>",
" Database = backend.get('Database')",
" File \"/home/gnuhealth/.local/lib/python3.6/site-packages/trytond/backend/__init__.py\", line 25, in get",
" module = importlib.import_module(modname)",
" File \"/usr/lib/python3.6/importlib/__init__.py\", line 126, in import_module",
" return _bootstrap._gcd_import(name[level:], package, level)",
"ModuleNotFoundError: No module named 'trytond.backend.postgres'"
``