Hello,
I am using Docker compose and there is nothing in the Tryton database. I am trying to connect proteus to a running Trython to set it up.
$ sudo docker-compose up -d
(Running in Docker, I am not sure where the configuration file path is that I can pass into config.set_trytond
.)
$ `pip install proteus`
`>>> from proteus import config `
`>>> config.set_trytond('tryton-postgres') `
But I get the error
ModuleNotFoundError: No module named 'trytond.backend.'
Full error trace and yml file below.
Hope you can help.
Kind regards,
Douglas
Here is my docker-compose.yml
…
version: "3.5"
services:
tryton:
image: tryton/tryton:5.4
restart: always
environment:
- DB_HOSTNAME=tryton-postgres
- DB_PASSWORD=${POSTGRES_PASSWORD}
- TRYTOND_WEB__NUM_PROXIES=1
volumes:
- tryton-data:/var/lib/trytond/db
- tryton-www-static-data:/var/lib/trytond/www
expose:
- "8000"
depends_on:
- tryton-postgres
tryton-postgres:
image: postgres:12
restart: always
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_DB=tryton
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- tryton-postgres-data:/var/lib/postgresql/data
expose:
- "5432"
nginx:
image: nginx:1.17
restart: always
environment:
- TZ=Europe/London
volumes:
- ./nginx-config:/etc/nginx/conf.d:ro
- tryton-www-static-data:/var/www/static/tryton:ro
ports:
- "80:80"
- "443:443"
depends_on:
- tryton
volumes:
tryton-data:
external: True
tryton-postgres-data:
external: True
tryton-www-static-data:
Here is the full error
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-10-33ed1c5263cc> in <module>
----> 1 config.set_trytond('tryton-postgres')
~/miniconda3/lib/python3.7/site-packages/proteus/config.py in set_trytond(database, user, config_file)
291 config_file=None):
292 'Set trytond package as backend'
--> 293 _CONFIG.current = TrytondConfig(database, user, config_file=config_file)
294 return _CONFIG.current
295
~/miniconda3/lib/python3.7/site-packages/proteus/config.py in __init__(self, database, user, config_file)
229 from trytond.config import config
230 config.update_etc(config_file)
--> 231 from trytond.pool import Pool
232 from trytond.transaction import Transaction
233 self.database = database
~/miniconda3/lib/python3.7/site-packages/trytond/pool.py in <module>
4 from threading import RLock
5 import logging
----> 6 from trytond.modules import load_modules, register_classes
7 from trytond.transaction import Transaction
8 import builtins
~/miniconda3/lib/python3.7/site-packages/trytond/modules/__init__.py in <module>
15
16 import trytond.tools as tools
---> 17 from trytond.cache import Cache
18 from trytond.config import config
19 from trytond.exceptions import MissingDependenciesException
~/miniconda3/lib/python3.7/site-packages/trytond/cache.py in <module>
14 from sql.functions import CurrentTimestamp, Function
15
---> 16 from trytond import backend
17 from trytond.config import config
18 from trytond.transaction import Transaction
~/miniconda3/lib/python3.7/site-packages/trytond/backend/__init__.py in <module>
19 _modname = 'trytond.backend.%s' % name
20 try:
---> 21 _module = importlib.import_module(_modname)
22 except ImportError:
23 if not pkg_resources:
~/miniconda3/lib/python3.7/importlib/__init__.py in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
129
ModuleNotFoundError: No module named 'trytond.backend.'