Hi Maxime,
thank you for the idea, but the problem happens already at the secibd line from the documentation that I referenced:
>>> from proteus import config as pconfig
>>> config = pconfig.set_trytond('sqlite:///:memory:')
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/csb43/i18n/__init__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.i
o/en/latest/pkg_resources.html
import pkg_resources
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/csb43/i18n/__init__.py:21: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
lc, encoding = locale.getdefaultlocale()
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/braintree/dispute.py:80: DeprecationWarning: Use ProtectionLevel enum instead
warnings.warn("Use ProtectionLevel enum instead", DeprecationWarning)
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/braintree/search.py:79: DeprecationWarning: Use protection_level parameter instead
warnings.warn("Use protection_level parameter instead", DeprecationWarning)
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/zeep/utils.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi
Traceback (most recent call last):
File "<input>", line 1, in <module>
config = pconfig.set_trytond('sqlite:///:memory:')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/proteus/config.py", line 329, in set_trytond
_CONFIG.current = TrytondConfig(database, user, config_file=config_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/proteus/config.py", line 282, in __init__
self.pool.init()
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/pool.py", line 167, in init
restart = not load_modules(
^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/modules/__init__.py", line 388, in load_modules
with Transaction().start(database_name, 0):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 216, in start
Cache.sync(self)
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/cache.py", line 252, in sync
cursor.execute(*table.select(
sqlite3.OperationalError: no such table: ir_cache
The script you recommended, also has the same problem. It even doesn’t recognize the database setting and insists on opening an SQLite database file in a completely unrelated location:
$ ./tryton_demo.py --config=test.conf
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
from crypt import crypt as _crypt
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/braintree/dispute.py:80: DeprecationWarning: Use ProtectionLevel enum instead
warnings.warn("Use ProtectionLevel enum instead", DeprecationWarning)
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/braintree/search.py:79: DeprecationWarning: Use protection_level parameter instead
warnings.warn("Use protection_level parameter instead", DeprecationWarning)
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/csb43/i18n/__init__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/csb43/i18n/__init__.py:21: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
lc, encoding = locale.getdefaultlocale()
/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/zeep/utils.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi
Traceback (most recent call last):
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 179, in start
database = backend.Database(database_name).connect()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/backend/sqlite/database.py", line 365, in connect
self._make_uri(), uri=True,
^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/backend/sqlite/database.py", line 439, in _make_uri
raise IOError("Database '%s' doesn't exist!" % db_path)
OSError: Database '/home/toni/db/demo.sqlite' doesn't exist!
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 239, in stop
self.rollback()
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 356, in rollback
for datamanager in self._datamanagers:
^^^^^^^^^^^^^^^^^^
AttributeError: 'Transaction' object has no attribute '_datamanagers'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/toni/mnt/tryton/setups/./tryton_demo.py", line 1014, in <module>
main(options.database, options.modules, options.demo_password,
File "/home/toni/mnt/tryton/setups/./tryton_demo.py", line 917, in main
config = set_config(database, config_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/mnt/tryton/setups/./tryton_demo.py", line 26, in set_config
return pconfig.set_trytond(database, config_file=config_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/proteus/config.py", line 329, in set_trytond
_CONFIG.current = TrytondConfig(database, user, config_file=config_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/proteus/config.py", line 282, in __init__
self.pool.init()
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/pool.py", line 167, in init
restart = not load_modules(
^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/modules/__init__.py", line 388, in load_modules
with Transaction().start(database_name, 0):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 218, in start
self.stop(False)
File "/home/toni/.virtualenvs/tryton/lib/python3.11/site-packages/trytond/transaction.py", line 241, in stop
self.database.put_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'put_connection'
FWIW, I am using a dedicated virtualenv with Tryton 7.0.3 on a Debian Bookworm machine.