I’ve install an start trytond properly, i’m having an issue while trying to initialize the database with tryton.
using the command: ./trytond-admin --all –database=health where health is my database. im having the error: cannot import name table from sql.
I know this is an old topic, but I had the same issue when upgrading to 7.4 and this topic was the first search result.
This message does not necessarily indicate that python-sql is not installed; it happens because Tryton includes a folder called sql which gets Python confused with its sql module:
root@22cc4b9bc3de:/usr/local/lib/python3.11/dist-packages/trytond# echo -e "from sql import Table\nprint('OK')" | python3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Table' from 'sql' (/usr/local/lib/python3.11/dist-packages/trytond/sql/__init__.py)
root@22cc4b9bc3de:/usr/local/lib/python3.11/dist-packages/trytond# cd $OLDPWD
root@22cc4b9bc3de:/var/lib/trytond# echo -e "from sql import Table\nprint('OK')" | python3
OK
So the solution is to not run trytond from its installation directory, but from another directory (e.g. /home/tryton).