I was working in tryton version 5.0 from a long time in a virtualenvironmentA on a Linux server and today i decided to work with two versions, so i have gone and i installed tryton version 6.0 in another virtual environment, but Unfortunately, after installing tryton and trytond with those two commands:
i was about seeing my version in this virtual environement to confirm that everything is good with the command tryton --version
response was:
Unable to init server: Could not connect: Connection refused
(tryton:12200): Gtk-WARNING **: 10:55:20.878: Locale not supported by C library.
Using the fallback 'C' locale.
Unable to init server: Could not connect: Connection refused
(tryton:12200): Gtk-ERROR **: 10:55:21.084: Can't create a GtkStyleContext without a display connection
and lastly when i have gone to my version 5.0 to see that the environment has not be affected , but the same error displayed when i put tryton --version and trytond version become 6.0 not 5.0.
what does mean this error, and how i can fix my previous version to back to her first version and i want to know my work it can be affected if i will update now my database in the previous version!
And what about the server trytond that exist in another virtual environment version 5.0 it becomes 6.0, is it normal and if i will update my database over there in my version 5.0, it will be affected ?
To me, it seems you forgot to activate your virtual environment, so you installed tryton version 6.0 globally. To test that, just make sure you don’t have any virtual environment active and execute the command trytond-admin --version. If it comes back with information, you have globally installed tryton.
The best way I can think of is to remove it again (with pip) and see if everything is ok with your 5.0 environment. Then create a new virtual environment for 6.0 and activate it and install version 6.0.
Also you cannot run both version at the same port. Default this port is 8000, but one of the version should run on another port e.g. 8060. You have to set that up in your trytond.conf
When upgrading from 5.0 to 6.0 I personally will do the small steps, so go from 5.0 to 5.2 and so on until 6.0
yeah unfornatully i found that the trytond was installed globaly , version 6.0.0 , which command i should use to unistall this version 6.0.0 and keep my old version 5.0
basically the commands you have used but now using uninstall. I think when you have uninstalled tryton, you will be able to run tryton version 5.0 from within you virtual environment again. Because you run tryton version 5 in a virtual environment, this installation should not be affected but Python first takes the global packages before using the virtual environment one.
BTW, if you want to run more version alongside each other, make sure you also use separate databases as well.
Well it’s my personal preference to do it one step at a time because I’m always walk into trouble when doing big steps
Am using linux i go to my virtual environement by workon name_project; otherwise again when i update my database there was another error in my version 5.0 :
20549 139930273048384 [2021-09-10 12:50:14,954] MainProcess INFO trytond.modules account_statement_aeb43:registering classes
Traceback (most recent call last):
File "trytond/bin/trytond-admin", line 21, in <module>
admin.run(options)
File "/home/caroline/venv/project/trytond/trytond/admin.py", line 53, in run
activatedeps=options.activatedeps)
File "/home/caroline/venv/project/trytond/trytond/pool.py", line 149, in init
self.start()
File "/home/caroline/venv/project/trytond/trytond/pool.py", line 102, in start
register_classes()
File "/home/caroline/venv/project/trytond/trytond/modules/__init__.py", line 333, in register_classes
the_module = import_module(module)
File "/home/caroline/venv/project/trytond/trytond/modules/__init__.py", line 53, in import_module
module = importlib.import_module(fullname)
File "/home/caroline/venv/project/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/caroline/venv/project/trytond/trytond/modules/account_statement_aeb43/__init__.py", line 5, in <module>
from . import statement
File "/home/caroline/venv/project/trytond/trytond/modules/account_statement_aeb43/statement.py", line 6, in <module>
from csb43 import csb43
File "/home/caroline/venv/project/lib/python3.7/site-packages/csb43/csb43/__init__.py", line 25, in <module>
from .csb_file import File, ClosingFile # noqa: F401
File "/home/caroline/venv/project/lib/python3.7/site-packages/csb43/csb43/csb_file.py", line 11, in <module>
from .account import Account
File "/home/caroline/venv/project/lib/python3.7/site-packages/csb43/csb43/account.py", line 12, in <module>
from ..utils.compat import (
File "/home/caroline/venv/project/lib/python3.7/site-packages/csb43/utils/__init__.py", line 20, in <module>
from ..i18n import tr as _
File "/home/caroline/venv/project/lib/python3.7/site-packages/csb43/i18n/__init__.py", line 30, in <module>
languages += DEFAULT_LANGUAGES
NameError: name 'languages' is not defined
Ah, I see, you didn’t install Trytond in your environment with pip. Looking at your error, the problem seems to be in a package called csb43 and it looks like @pokoli can help you with that.