Installing OpenERP – openobject-server

NOTE: If you follow this guide it won’t work – so read it to see my mistakes but save yourself some frustration

Install the dependencies

Now on our nice clean server we need to install the required libraries.  To be honest – I am not sure what these are – we’ll start with this command

apt-get install -y postgresql graphviz python-psycopg2 python-lxml python-tz python-imaging

This list was taking from the server code INSTALL doc.  It differs from OpenERP’s documentation, and most other documentation.  We’ll see how we get on with this.

You need to run this as root btw – so sudo su or else stick a sudo in front. Running as root is considered poor practice – for now I don’t care.  About now, if you are unfamiliar with SSH, google how to cut and paste in Putty, or type the commands out manually, but generally I just highlight the text and right click in the terminal window in windows, and middle click in linux – but mileage may vary. 

Download openobject-server source files

Once that is done, it is time to get our sources.  Because we are developing we want the latest sources from launchpad.  This is not 100% trivial.  To learn about launchpad, getting a login, using bzr and other things is beyond the scope of this.  Try here http://doc.bazaar.canonical.com/latest/en/tutorials/tutorial.html and here http://20y.hu/20081012/how-to-use-different-ssh-keys-for-different-services-smoothly.html (this is advanced, but will save you grief one day when you write your own modules) – you also need to get launchpad logins and upload ssh keys.

For now if all you do is install bazaar with

apt-get install bzr

go to the folder you wish to store your sources – I use /usr/local/src and type

bzr branch lp:openobject-server

as root or using sudo.  This should start the sources downloading.  In todays case we downloaded 2473 revisions.

Compile and Install OpenErp Server

Now here is where reality bites.  All we should need to do now is go to the directory (/usr/local/src/openobject-server probably) and run

python setup.py install

and it works.  However we get the following errors.

Error: python module mako (Mako template engine) is required
Error: python module dateutil (Extensions to the standard datetime module) is required
Error: python module pydot (pydot module) is required
Error: python module reportlab (reportlab module) is required
Error: python module pywebdav (PyWebDAV is a standards compliant WebDAV server and library written in Python) is required

So we need to install these.

apt-get install python-pydot python-reportlab python-webdav python-mako python-dateutil

and try again.  Now we get this error.

Error: python module pywebdav (PyWebDAV is a standards compliant WebDAV server and library written in Python) is required

But we just installed it?  Time to tear your hair out. Yes.  Luckily, some other people have gone through this pain already, and besides this might not happen to you, as it will probably be fixed by the time you use this, but just in case.

root@openerp-alpha2:/usr/local/src/openobject-server# cd /usr/local/lib/python2.6/dist-packages/
root@openerp-alpha2:/usr/local/lib/python2.6/dist-packages# easy_install PyWebDav
root@openerp-alpha2:/usr/local/lib/python2.6/dist-packages# mkdir pywebdav
root@openerp-alpha2:/usr/local/lib/python2.6/dist-packages# mkdir pywebdav/Davserver
root@openerp-alpha2:/usr/local/lib/python2.6/dist-packages# cp PyWebDAV-0.9.4-py2.6.egg/DAV/* pywebdav
root@openerp-alpha2:/usr/local/lib/python2.6/dist-packages# cp PyWebDAV-0.9.4-py2.6.egg/DAVServer/* pywebdav/Davserver

and we try again.

python setup.py install

and it installs. For now we rejoice.  If I could be bothered, we would set to run as a service.  We aren’t.  Some of you may wonder why I don’t just update this post to make it all run smoothly – trust me, these lessons now are worth experiencing.  At least you won’t be so shocked when things don’t go perfectly in future. 

Next configuring postgres.

Leave a Reply

You must be logged in to post a comment.