This is long overdue. I made some notes when I was getting OpenERP server working on Mac OS X in March 2009 and just never got a chance to publish them. At the time of trying to get this all working there was very little info available as officialy Mac OS X was not supported but as it is built on Open Source technologies that are cross platform it should be possible and it is.
At the time of installation the version of OpenERP available was 5.0.0-3 and I was working with an iMac running OS X 10.5 (latest patches installed) OpenERP is built using the Python programming language, Turbo Gears framework, some Python libraries and PostgreSQL. All of these are available in various forms for Mac OS X and I made use of one or another source for installation. There may be better ways and or shortcuts but that is the fun of figuring it out. You will always be able to look back and say it would have been easier if I did x or y.
At time of doing this install there were issues with OpenERP and python-xml on Python 2.6 so I stuck to Python 2.5.1 which was the default installed although I later changed to the ports version of 2.5.x. There are a number of libraries needed and for some of those I made use of the great ports system from darwinports.com Before installing the ports system you will need to ensure that you have XCode Tools Developer Tools installed with the optional command line tools as this will be required for the ports system. XCode is on the Leopard install DVD or else you can get it directly from Apple but you will need to signup for a free Apple ADC account. I tried this first but unfortunately after waiting for the 1GB download to complete I found that the file was corrupted. In the end I installed it from the DVD. After install XCode then grab the ports install file and get it installed. Now we are ready to start installing the supporting libraries required.
First thing to do is update the ports system so that we get the latest version:
sudo port -d selfupdate
Now some Python libraries
- psycopg2
http://initd.org/projects/psycopg2sudo /opt/local/bin/port install py25-psycopg2 +postgresql83
- reportlab
http://www.reportlab.comsudo /opt/local/bin/port install py25-reportlab
- pychart
http://home.gna.org/pychartsudo /opt/local/bin/port install py25-chart
- pydot
http://pypi.python.org/pypi/pydot/1.0.2sudo /opt/local/bin/easy_install-2.5 pydot
- mxdatetime
http://www.egenix.com/products/python/mxBase/sudo /opt/local/bin/easy_install-2.5 egenix-mx-base
I installed this one manually using the UCS2 file from the authors site
- xml, lxml and libxslt1
http://pypi.python.org/pypi/PyXML/0.8.4
http://pypi.python.org/pypi/lxml/2.2sudo /opt/local/bin/port install py25-xml sudo /opt/local/bin/port install py25-lxml sudo /opt/local/bin/port install py25-libxslt
- tz (timezone library)
http://pytz.sourceforge.netsudo /opt/local/bin/easy_install-2.5 pytz
- PIL: Python Imaging Library (required for reportlab)
http://www.pythonware.com/products/pilsudo /opt/local/bin/port install py25-pil
- vobject: iCalendar and VCards parsing
http://vobject.skyhouseconsulting.comsudo /opt/local/bin/easy_install-2.5 vobject
After installing the libraries I changed from the default Python interpreter to the one that was installed at the time of installing the various libraries. This way ensuring that all the new libraries are seen without having to alter library paths.
cd /usr/bin sudo rm python (it is a symlink so this is fine) sudo ln -s /opt/local/bin/python2.5 python
Next we need to install PostgreSQL. You can get this from the ports system or else use a prebuilt binary. I had already installed it from a prebuilt binary before installing the ports when I had tried getting things working a different way. The prebuilt binary I used was from EnterpriseDB
http://www.enterprisedb.com/products/pgdownload.do#osx
Now download OpenERP server and install it as normal following the steps in the install guide for Linux.
sudo python setup.py install
This will install the relevant files in the following location:
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/openerp-server
The executable for OpenERP server can be found in the following location:
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/openerp-server
The configuration file is missing from the tar file that I downloaded so I have included the info below:
/opt/local/etc/openerp-server.conf
[options]
without_demo = False
upgrade = False
verbose = False
xmlrpc = True
db_user = openerp
db_password =
root_path = None
soap = False
translate_modules = ['all']
# db_name = {the default OpenERP database to use; set to False if you have not yet created first database from client menu}
db_name = False
netrpc = True
demo = {}
interface =
db_host = localhost
db_port = 5432
port = 8069
addons_path = None
reportgz = FalseNext I installed the OpenERP web client as it was a requirement that the system be available to multiple platforms (Windows, Linux & Mac OS X) and there was no official desktop client for OS X although there were some betas available. It was decided to stick to the web client as it also meant that no desktops would need to be maintained.
Install TurboGears as it is required for the web client:
sudo /opt/local/bin/easy_install-2.5 TurboGears==1.0.8
To check it is installed correctly execute
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/tg-admin info
Now download and install the OpenERP web client as normal following the steps in the install guide for Linux
sudo /opt/local/bin/easy_install-2.5 -U openerp-web
For the current version (5.0.0-3) of OpenERP server you need to patch the db connection script
https://bugs.launchpad.net/openobject-server/+bug/330999/comments/2
--- sql_db.py.bak 2009-03-05 22:59:42.000000000 +0100
+++ sql_db.py 2009-03-06 00:12:34.000000000 +0100
@@ -181,9 +181,11 @@
def rollback(self):
return self._cnx.rollback()
- @check
def __getattr__(self, name):
- return getattr(self._obj, name)
+ if name =='_obj':
+ raise AttributeError("No attribute named _obj")
+ else:
+ return getattr(self._obj, name)
class ConnectionPool(object):
def __init__(self, pool, dbname):
Next thing is to ensure that the software starts automatically when ever the machine is started. To do this we create a couple of launchd files. I am sure these could be improved but I am a Mac OS X novice and these worked for me.
org.openerp.openerpserver.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PY_USE_XMLPLUS</key>
<string></string>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin</string>
</dict>
<key>GroupName</key>
<string>wheel</string>
<key>UserName</key>
<string>root</string>
<key>Label</key>
<string>org.openerp.openerpserver</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/openerp-server</string>
<string>-c /opt/local/etc/openerp-server.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Open ERP server</string>
<key>StandardOutPath</key>
<string>/tmp/openerp-server.out</string>
<key>StandardErrorPath</key>
<string>/tmp/openerp-server.err</string>
</dict>
</plist>org.openerp.openerpweb.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PY_USE_XMLPLUS</key>
<string></string>
<key>PYTHON_EGG_CACHE</key>
<string>/tmp/</string>
</dict>
<key>GroupName</key>
<string>wheel</string>
<key>UserName</key>
<string>root</string>
<key>Label</key>
<string>org.openerp.openerpweb</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/start-openerp-web</string>
<string></string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Open ERP web server</string>
<key>StandardOutPath</key>
<string>/tmp/openerp-web.out</string>
<key>StandardErrorPath</key>
<string>/tmp/openerp-web.err</string>
</dict>
</plist>That is it. Everything should now be up and running. A link I found later on that may be of assistance would be http://devteam.taktik.org/index.php?/archives/9-How-to-install-Open-ERP-5.0.0-on-Mac-OS-X-10.5-Leopard.html
In the end the process is not too much more difficult than Linux but it is just that there is no documentation available currently.
Comments
I love to make use of my
I love to make use of my spare time reading various internet resources. Right now I come across your blog and I thought it was one of the better free information available online!
First-class information
First-class information indeed. I have been awaiting for this tips.
website design
db script
Hello, sorry, me again, where do i put the patch code for the db connection script? That's the only point i need to make my server run correctly, all the precedent steps i've accomplished them succesfully. Thanks for this info.
Regards.
Problems with mxdatetime
Hello Sean, first of all, I thank you for this steps you share with all the mac users, it's quite useful. I'm following step by step the installation process that you have written above, however, I can't install the mxdatetime like the way your description says, neither from the instructions of the developer, could you tell me please what did you do in order to install this? Thanks in advance for any kind of information that you may provide me.
I apologize for any disturb that I might cause you.
Regards.
Jorge
Thanks for sharing this
Thanks for sharing this information
Ports followup
Thanks,
It's a bit late I confess.
I went through the process and everything installed like a charm :)
I just can't install the web client though. It say says that PyXML is missing but it's not ??
So I am stuck there. :(
I am assuming it's just a question of pointing to the right directory.
Christophe
Ports and followup
Hi
The ports stuff is available at http://darwinports.com where there is a link at the top of the page for the latest version. Just make sure you have the XCode stuff installed with the command line binaries first as it will be required to build the ports. The command line stuff is one of the options so just make sure it is checked.
With regards to the links there is no specific thing you need to do with them. I was being a little verbose and including them as a reference in case you wanted more information and for myself to remind me where I had browsed to better understand the components.
Hope this helps as I am also new to Mac OS X which was why I wrote it up :)
Sean
Ports Install files
Hello Sean,
I first want to thank you for the install process on MAC OSX.
I am quite new to MAC. I can't locate the Ports install file you are mentioning at the beginning of the process.
On another topic, you give a link to a web site for each library to install. What do we do with it?
Thanks
Christophe
Post new comment