Installing tryton server - How to ? and some questions...

742 views
Skip to first unread message

Maxime Richez

unread,
May 2, 2017, 5:34:24 AM5/2/17
to tryton
Hi,

This subject is often coming back on the forum.

We need some advices to correctly install trytond 4.2 on a debian server… (for production or testing)


Here are our first steps  on a debian 9.0 :


- installing some packages : sudo apt install python virtualenv mercurial python-pip


- creating « tryton » user : sudo adduser tryton


Using user « tryton » :


- creating directory where to install tryton :

mkdir /srv/tryton/4.2


- pip install hgnested

and configuring .hgrc in /home/tryton :

[ui]

username = Tryton <try...@xxx.com>

[extensions]

hgnested =


- defining virtualenv in /srv/tryton/4.2 :

virtualenv .venv/tryton


- switching into virtualenv :

/srv/tryton/4.2/source .venv/tryton/bin/activate


- cloning in /srv/tryton/4.2 trytond 4.2 and all the modules with nclone :

hg nclone http://hg.tryton.org/4.2/trytond -b 4.2


- configuring trytond.cfg to use postgresql database :

[database]

uri = postgresql://tryton:tryton@postgresqlsrv:5432/


Questions ?


« pip install . » or « python setup.py install » ? 


How to install all python dependencies for all the modules ?


- Is there a list with all the requirements to use with pip ?

- Should i execute trytond-admin –all and install dependencies one by one each time i get an error ?

- What about issue https://bugs.tryton.org/issue5960 ?


Waiting for your advices/suggestions... Then we could add this "how-to" to documentation..
Thanks !

Sergi Almacellas Abellana

unread,
May 2, 2017, 9:42:55 AM5/2/17
to try...@googlegroups.com
El 02/05/17 a les 11:34, Maxime Richez ha escrit:
> « pip install . » or « python setup.py install » ?

Both should work. IIRC there is no diference between them.
>
>
> How to install all python dependencies for all the modules ?
>
>
> - Is there a list with all the requirements to use with pip ?

I don't think so, and this will be hard to maintain as it may change for
each version.
>
> - Should i execute trytond-admin –all and install dependencies one by
> one each time i get an error ?
>
> - What about issue https://bugs.tryton.org/issue5960 ?

The solution to this issue was to use module_list from tryton_tools [1],
to call python setup.py develop on each module to install it's
dependencies.


[1] http://hg.tryton.org/tryton-tools/file/f542d01b2374/module_list.py


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Maxime Richez

unread,
May 2, 2017, 10:01:33 AM5/2/17
to tryton

So, what's the actual solution to install all python dependencies correctly (as the patch is not released)?

How does everybody install a tryton server at customers ?

Sergi Almacellas Abellana

unread,
May 2, 2017, 10:38:04 AM5/2/17
to try...@googlegroups.com
El 02/05/17 a les 16:01, Maxime Richez ha escrit:
>
> So, what's the actual solution to install all python dependencies
> correctly (as the patch is not released)? >
> How does everybody install a tryton server at customers ?

We have a module that contains all the dependencies that we use and some
customization code. We install this module with pip install so all the
dependent packages (and it's dependencies) are installed.

Hope it helps.

P.S: Indeed we build a container image with the module and other
packages to deploy on production (psycopg2, uwsgi, tryton-redis, etc.)
but this may be out of the scope of this thread.

Dominique Chabord

unread,
May 2, 2017, 10:39:37 AM5/2/17
to tryton
I setup an environment and pip install dependencies.
I don't use the pip way for trytond code because it requires to
iterate installation of each module and it is too long for my process

I run trytond from source instead and manage dependencies from a list
I established
manually. There are few but I don't feel comfortable on this point.

I will think again about your idea of automating installation of
dependencies found in modules.
My first problem is that I use to set the environment first, then
download the code. I should maybe do the other way, download the code
first, then set the environment according to code.

Dominique Chabord

unread,
May 2, 2017, 10:47:49 AM5/2/17
to tryton
by the way Trytond 4.4 and sao 4.4 seem to start correctly on 4.2 dependencies.

Sergi Almacellas Abellana

unread,
May 2, 2017, 10:49:52 AM5/2/17
to try...@googlegroups.com
El 02/05/17 a les 16:47, Dominique Chabord ha escrit:
> by the way Trytond 4.4 and sao 4.4 seem to start correctly on 4.2 dependencies.
Not if you use the new account_payment_stripe module which is not
available on 4.2

Dominique Chabord

unread,
May 2, 2017, 10:54:49 AM5/2/17
to tryton
2017-05-02 16:49 GMT+02:00 Sergi Almacellas Abellana <se...@koolpi.com>:
> El 02/05/17 a les 16:47, Dominique Chabord ha escrit:
>>
>> by the way Trytond 4.4 and sao 4.4 seem to start correctly on 4.2
>> dependencies.
>
> Not if you use the new account_payment_stripe module which is not available
> on 4.2

You're a wizard ! I just took it off to start my 4.4 server (and
forgot it) and planned to check it deeper later.
So this is the "try and correct" mentionned by Maxime ;-)

Maxime Richez

unread,
May 2, 2017, 11:06:25 AM5/2/17
to tryton, dominiqu...@sisalp.org
I'm curious to read how other people do their install...

So actually, there's no "clean" and universal method to proceed python dependencies installation on a tryton server?

Axel Braun

unread,
May 2, 2017, 11:17:54 AM5/2/17
to try...@googlegroups.com

Gesendet: Dienstag, 02. Mai 2017 um 17:06 Uhr
Von: "Maxime Richez" <maxime...@gmail.com>
An: tryton <try...@googlegroups.com>
Cc: dominiqu...@sisalp.org
Betreff: Re: [tryton] Installing tryton server - How to ? and some questions...

> I'm curious to read how other people do their install...

> So actually, there's no "clean" and universal method to proceed python dependencies installation on a tryton server?
 
I think there is more than one way to do it.
For openSUSE I have moved the dependencies into the package, so when installing from package management

zypper install trytond_account

as example it will check all requirements and resolve automatically - including database....
I guess it is similar for Debian, where you have system packages as well

Cheers
Axel

Maxime Richez

unread,
May 3, 2017, 3:08:18 AM5/3/17
to tryton

>I guess it is similar for Debian, where you have system packages as well

Yes, of course, but we are using from source...

Anyway, thanks for the people who reply... even if i'm still looking for the best solution :-)

Dominique Chabord

unread,
May 3, 2017, 3:35:02 AM5/3/17
to tryton
2017-05-03 9:08 GMT+02:00 Maxime Richez <maxime...@gmail.com>:
>
>> >I guess it is similar for Debian, where you have system packages as well

If you go through packaging on Debian, be careful to disallow
automated upgrade of trytond packages

>
>
> Yes, of course, but we are using from source...
>
> Anyway, thanks for the people who reply... even if i'm still looking for the
> best solution :-)

Best for you, indeed. Installation is the easy part. Long term
maintenance is the real stake and, imho, installation must first be
driven by maintenance requirements.
On production servers, you usually must care about recovery plans in
case you loose part or total of the production server.

Dominique Chabord

unread,
May 3, 2017, 4:51:17 AM5/3/17
to tryton
Hi,


for those who would like to compare their dependency set, I
"decompiled" my script to get the list of what it installs.

On a server ubuntu 14.04 minimal
with apt-get
wget man cron locales host lynx less nano ccrypt patch openssl tar
gzip whois zip unzip sudo expect rdiff adduser bc python python-pip
python-virtualenv python-simplejson python-bcrypt fail2ban postgresql
postgresql-client
then localisations et postgresql-server-dev-$postgres_version
and some specific tunings subroutines
POSTGRES_CONF_MODELS
POSTGRES_PERFORMANCE
POSTGRES_SECURITY
POSTGRES_LOCALISATION

with pip : Genshi python-dateutil lxml pycha pyyaml psycopg2 polib
python-sql relatorio "PyWebDAV>=0.9.8" pydot sphinx simplejson
python-Levenshtein goocalendar werkzeug m3-cdecimal py-bcrypt mock
pytz wrapt python-stdnum simpleeval cached_property ldap3 zeep PyPDF2
stripe

It may be outdated somehow because it must run older versions of
Trytond as well, and I add new requirements over time more than I
maintain the list. I go the lazy way and Tryton is very easy with me.
If you identify a need for an extra package I miss, thank you to mention.

Sergi Almacellas Abellana

unread,
May 3, 2017, 5:13:09 AM5/3/17
to try...@googlegroups.com
El 03/05/17 a les 10:51, Dominique Chabord ha escrit:
> Hi,
>
>
> for those who would like to compare their dependency set, I
> "decompiled" my script to get the list of what it installs.
>

Thanks for sharing.
> On a server ubuntu 14.04 minimal
> with apt-get
> wget man cron locales host lynx less nano ccrypt patch openssl tar
> gzip whois zip unzip sudo expect rdiff adduser bc python python-pip
> python-virtualenv python-simplejson python-bcrypt fail2ban postgresql
> postgresql-client
> then localisations et postgresql-server-dev-$postgres_version
> and some specific tunings subroutines
> POSTGRES_CONF_MODELS
> POSTGRES_PERFORMANCE
> POSTGRES_SECURITY
> POSTGRES_LOCALISATION
>
> with pip : Genshi python-dateutil lxml pycha pyyaml psycopg2 polib
> python-sql relatorio "PyWebDAV>=0.9.8" pydot sphinx simplejson
> python-Levenshtein goocalendar werkzeug m3-cdecimal py-bcrypt mock
> pytz wrapt python-stdnum simpleeval cached_property ldap3 zeep PyPDF2
> stripe

Some comments:

pywebdav is no longer required for 4.4 (as we do not have webdav anymore).

goocalendar is only required for tryton (but not for server).

sphinx is only required if you need to build the docs

AFAIU mock is only needed for running tests suits

About lxml, it's faster to use distribution packages as it contain the
compiled version, otherwise you need python development pacakges in
order to compile it.

I think m3-decimal is not required anymore.

Dominique Chabord

unread,
May 3, 2017, 5:44:23 AM5/3/17
to tryton
Thank you, Sergi,
I have adapted the script accordingly.

Doing this, I saw I forgot apt-get install of unoconv libreoffice-draw
libreoffice-writer libreoffice-calc
and I discovered (!) that the script already cares about specific
dependencies mentionned in modules. I have probably just to revisit
this old code.

Cédric Krier

unread,
May 3, 2017, 6:10:09 AM5/3/17
to tryton
No there is no universal method and there will never be.
Installation is a process that depends on the Operating System because
each one has it specificities.
That's why it is recommended to use the package manager from your OS to
install Tryton. And also this is why we list on the download page
distributions that have packaged Tryton.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Adrian Herrera Montenegro

unread,
May 4, 2017, 5:40:09 PM5/4/17
to tryton



- pip install hgnested

and configuring .hgrc in /home/tryton :

[ui]

username = Tryton <try...@xxx.com>

[extensions]

hgnested =


when I run this line, I got a Permission Denied error, because this command tries to write in the folder where python is installed. How could you handle that?

Karla Stenger

unread,
May 4, 2017, 5:48:56 PM5/4/17
to try...@googlegroups.com

​Run it inside a virtualenv is the most advisable option for Tryton and most python programs.​

​The alternative is to use:
​pip install --user hgnested
​but I do not recommend installing globallywith pip anyway.​

​Cheers,
Karla​

--
-------------------------
Karla  Mª  Stenger  Sábat
karla....@gmail.com

Vincent Bastos

unread,
May 5, 2017, 2:37:57 AM5/5/17
to tryton


On Tuesday, May 2, 2017 at 7:34:24 PM UTC+10, Maxime Richez wrote:
Hi,

This subject is often coming back on the forum.

We need some advices to correctly install trytond 4.2 on a debian server… (for production or testing)


Here are our first steps  on a debian 9.0 :


Hi Maxime,

I noticed that you are talking about the Debian distribution, so I thought I would point you to a great Debian package mirror for Tryton managed by Mathias Behrle.


Maxime Richez

unread,
May 5, 2017, 3:22:16 AM5/5/17
to tryton

Hi Maxime,

I noticed that you are talking about the Debian distribution, so I thought I would point you to a great Debian package mirror for Tryton managed by Mathias Behrle.

Hi Vincent,

I Know about debian package but i prefer installing from source... Thanks!
And about python packages needed for my installation, i'll follow Dominique and make a requirements.txt file with python dependencies
Reply all
Reply to author
Forward
0 new messages